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")

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")
  • Hi Thanks for the reply, when I run this it is giving me this error: ERROR 999999: Error executing function.\nFailed to execute – GBh Nov 12 '13 at 20:54
  • 2
    @Gbh I ran the code above at ArcGIS 10.2, except for the UpgradeGDB step because I wanted to not change them, and it worked fine - try print desc.release after setting desc to the Describe object and see if it works that far. – PolyGeo Nov 12 '13 at 21:48
  • @PolyGeo my process fails at the UpgradeGDB..I'm clueless why it does that I'm giving in the correct parameters – GBh Nov 12 '13 at 21:55
  • 2
    @Gbh I think you should Accept this as the Answer to your original Question and then ask a new one with a title like "What causes Upgrade Geodatabase to throw ERROR 999999?". That new question should be reproducible from the tool dialog, and if not, then use the Geoprocessing | Results window to Copy As Python Snippet. – PolyGeo Nov 12 '13 at 22:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.