English

How To: Save map documents in ArcGIS 10.x as previous version of ArcGIS in batch

Summary

Instructions provided describe how to use a sample script to batch save map documents in ArcGIS 10.x as earlier document versions of ArcGIS.

Procedure

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 them. 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)[0] + suffix + os.path.splitext(base)[1] 
	mxd.saveACopy(outloc + os.sep + base, version)
	arcpy.AddMessage(os.path.basename(item) + " has been converted")
  1. To run this sample script as a tool, paste the code above into a text editor and save as a .py file.
  2. Create a new custom toolbox.
  3. Right-click the toolbox, and select Add > Script.
Right-clicking the new toolbox displays the drop-down menu that includes the Add > Script option.
  1. In the Add Script window, name the tool, and click Next.
The Add Script window displays the Name, Label, Description and Stylesheet properties.
  1. In the Script File section, browse to the location of the .py file.
The Add sScript window displays the Script File property that provides the option to browse to the Python script file.
  1. Right-click the newly added script, select Properties, and add the following parameters:
    1. Under Display Name, type Input MXDs, and select ArcMap Document under Data Type. In the Parameter Properties section, select Yes for MultiValue.
    2. Under Display Name, type Output Location, and select Workspace under Data Type.
    3. Under Display Name, type Output Version, and select String under Data Type.
The Properties window of the new script displays the Display Name and Data Type parameters in the Parameters tab.
  1. 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 The image of 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.
The script Properties window displays the selected parameter and the option to set its version list.
  1. Double-click the Script tool to open and run it. Specify the Input MXDs, Output Location, and Output Version parameters. Click OK to run the tool.
The tool's window displaying the Input MXDs, Output Location and Output Versions parameters.

Related Information

Last Published: 5/26/2021

Article ID: 000011219

Software: ArcGIS for Desktop Advanced 10.1 ArcGIS for Desktop Basic 10.1 ArcGIS for Desktop Standard 10.1 ArcGIS-ArcEditor 10 ArcGIS-ArcInfo 10 ArcGIS-ArcView 10