I am trying to check the version of a file geodatabase before upgrading to 10.1, I have a list of file geodatabases and some of them are already in 10.1. Can anyone suggest me how to update only those with version less than 10.1?
I am using python script to do this:
arcpy.UpgradeGDB_management(r"C:\Test\Base.gdb", "PREREQUISITE_CHECK", "UPGRADE")
Answer
This code would work for you.
import arcpy
arcpy.env.workspace = r"C:\GIS\93_data\93"
workspaces = arcpy.ListWorkspaces("*", "FileGDB")
for workspace in workspaces:
desc = arcpy.Describe(workspace)
if desc.release != '3,0,0':
arcpy.UpgradeGDB_management(workspace, "PREREQUISITE_CHECK", "UPGRADE")
No comments:
Post a Comment