I have one gdb with lots of layer (~500) and to receive empty gdb I delete all records from layers. I Use deleterows / TruncateTable but for one layers take about 1-3 minutes.

Is there a faster way to get an empty gdb without records using python?

  • Is your problem on how to delete all features from an existing gdb or to create an empty gdb?
    – R.K.
    Commented Dec 9, 2012 at 17:58

1 Answer 1


Not sure exactly what you mean - but if you want all empty but identical classes in a new gdb, there's the 'Import XML Workspace Document', if you have preprocessed an 'Export XML Workspace Document'.

From: Import XML Workspace Document (Data Management) Desktop » Geoprocessing » Tool reference » Data Management toolbox http://resources.arcgis.com/en/help/main/10.1/index.html#//00170000014s000000

arcpy.ImportXMLWorkspaceDocument_management("C:/Data/Target.gdb", "C:/Data/StJohnsData.xml", "SCHEMA_ONLY", "DEFAULTS")

...or, if had a gdb copy or replica in it's original 'empty state', could overwrite with a new empty one.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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