Select to view content in your preferred language

Combining geodatabases

8457
4
12-10-2012 06:33 AM
PeterHopkin1
Emerging Contributor
I need to combine two geodatabases into one. The geodatabases are being built from separate sources, but contain identical features classes, and are spatially different. I can combine the gdbs by a cumbersome solution, layer by layer, but I wonder if there is a more elegant way to do this?

My cumbersome method is to:
create a new gdb
copy in all the feature datasets from one gdb (using copy / paste in ArcCatalog)...so far, so good.
Combine data from the second gdb using the Append command from ArcToolBox...


But...when I append data from the second gdb...the command only works at the feature class level, and cannot append an entire feature dataset. This means I have to wade through each feature class layer by layer, appending them to the new gdb. Surely there must be a more elegant way to combine the two gdb's with a simpler command?
0 Kudos
4 Replies
MichaelVolz
Esteemed Contributor
You should be able to do this with python scripting.

You should be able to have python create a new file geodatabase.

Then use ListFeatureClasses from your first file geodatabase to copy this data into your new file geodatabase.

Then use ListListFeatureClasses from your second file geodatabase to append this data into your new file geodatabase onto the feature classes that were created when the data from the first file geodatabase was copied into the new file geodatabase.

You might consider posting this thread in the python subforum.
0 Kudos
PeterHopkin1
Emerging Contributor
You should be able to do this with python scripting.

You should be able to have python create a new file geodatabase.

Then use ListFeatureClasses from your first file geodatabase to copy this data into your new file geodatabase.

Then use ListListFeatureClasses from your second file geodatabase to append this data into your new file geodatabase onto the feature classes that were created when the data from the first file geodatabase was copied into the new file geodatabase.

You might consider posting this thread in the python subforum.


Thank you...but first I have to learn python...could be a slippery subject?
0 Kudos
deleted-user-RL41aR80ctiL
Deactivated User

Kind of, you can adapt it to your particular case.

import arcpy
arcpy.env.overwriteOutput = True


try:
   ws = arcpy.env.workspace = "your workspace"
   a = arcpy.ListWorkspaces("", "Access")
   print a
   for x in a:
      b = arcpy.env.workspace = x
      c = arcpy.ListTables()
      for y in c:
         out = "destination folder"
         arcpy.TableToDBASE_conversion(y, out)


except:
   print "Se ha producido un error"
   print(arcpy.GetMessages(2))

0 Kudos
curtvprice
MVP Esteemed Contributor

You can also do this kind of thing with Model Builder‌. In fact it's awfully handy for simple but cumbersome once-off tasks like this.  Advanced iteration in Model Builder can get complicated and takes some skill, but you don't have to write code.

0 Kudos