Appending multiple GeoDatabases into one

3847
2
07-26-2014 09:18 AM
Highlighted
New Contributor

I have 5 geodatabases with identical data but of different areas. I am trying to append data from all five to one new geodatabase. There are about 50 feature classes in each geodatabase so I am looking for a script to automate the process.

Thanks

Reply
0 Kudos
2 Replies
Highlighted
Occasional Contributor

Hi Ian.

I have a code snippet that you can use, To use it Replace the <outputGDB> and <InputGDB1><InputGDB2><InputGDBN> values.

WARNING: It's tested with GDB with the exactly same schema in all GDBs.

import arcpy

from arcpy import env

##Destination GDB

GDBD="<output GDB>"

##List of Origin GDB

GDBS=["<inputGDB1>","<inputGDB2>","...","<inputGDBN>"]

##Set Environment

arcpy.env.workspace=GDBD

##Get List of FDS

FDS=arcpy.ListDatasets()

##Get List of Root Feature Classes

ROOTFCS=arcpy.ListFeatureClasses()

##Append elements in Root Feature Classes

for fcr in ROOTFCS:

    appendinput=[]

    for FCI in GDBS:

        appendinput.append(FCI+"/"+fcr)

    ##print appendinput

    arcpy.Append_management(appendinput,GDBD+'/'+fcr,"TEST")

##Append elements of Feature Classes inside Feature Datasets

for FD in FDS:

    for FC in arcpy.ListFeatureClasses("*","",FD):

        appendinput2=[]

        for FCI2 in GDBS:

                appendinput2.append(FCI2+"/"+FC)

        ##print appendinput2

        arcpy.Append_management(appendinput2,GDBD+'/'+FC,"TEST")

Reply
0 Kudos
Highlighted
Occasional Contributor

Please see the following video and tool Append Multiple Geodatabase - YouTube 

Reply
0 Kudos