Thursday, 14 November 2019

ArcGIS 10.1 Upgrade Geodatabase check version?


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

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...