How To: Save map documents in ArcGIS 10.x to previous version of ArcGIS in batch
Instructions provided describe how to use a sample script to batch save map documents in ArcGIS 10.x as earlier document versions of ArcGIS.
After migrating to another version of ArcGIS, older map documents are upgraded to the installed version the next time they are saved. To share the map documents with older ArcGIS clients, use the Save A Copy command from the ArcMap File menu to save each map document.
However, if there are many map documents involved, a Python script tool can be used to batch convert. Apply the following process to avoid opening each document.
Below is a sample Python script for saving map documents as earlier document versions of ArcGIS.
Note: The following procedure only provide conversions up to version 10.3.
import arcpy, sys, os, string mxdList = string.split(arcpy.GetParameterAsText(0), ";") outloc = arcpy.GetParameterAsText(1) version = arcpy.GetParameterAsText(2) suffix = "_"+ version.replace(".", "") for item in mxdList: item = item.strip('\'') mxd = arcpy.mapping.MapDocument(item) base = os.path.basename(item) base = os.path.splitext(base) + suffix + os.path.splitext(base) mxd.saveACopy(outloc + os.sep + base, version) arcpy.AddMessage(os.path.basename(item) + " has been converted")
- To run this sample script as a tool, paste the code above into a text editor and save as a .py file.
- Create a new custom toolbox.
- Right-click the toolbox and select Add > Script.
- In the wizard, name the tool, and click Next.
- Navigate to the location of the .py file.
- Right click the newly added script and select Properties. Add the following parameters in the Display Name and Data Type section: Input MXDs with ArcMap Document data type, Output Location with Workspace data type, and Output Version with String data type.
- Click the Output Version parameter, and select Value List in the Filter drop-down box under the Parameter Properties section. Add the value list using the … button .
Note: Using the version '10.1' option from version 10 does not work. The function can only save to the current or previous versions.
- Double-click the Script tool to open and run it. Specify the input MXDs, output location, and output version. Click OK to run.
Last Published: 9/23/2019
Article ID: 000011219
Software: ArcMap 10.4.1, 10.4, 10.3.1, 10.3, 10.2.2, 10.2.1, 10.2, 10.1, 10