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
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")
Please see the following video and tool Append Multiple Geodatabase - YouTube