Copying domains from one GDB to another

13290
12
03-10-2015 08:09 AM
Randy_A_Stapleton
New Contributor III

Hi,

Does anyone know a good method for copying domains from one geodatabase to another? I feel like this should be a quick and painless task.


Thanks,

12 Replies
Brian_McLeer
Occasional Contributor II

I had this same issue. I was developing the schema in an FGDB, and I assumed you could simply copy and paste the feature class over to SDE and the domains would transfer over as this way would work with ArcMap.

For a workaround, I did the following steps:

-  Export new schema to XML workspace document with data included

-  Import XML workspace document into SDE, this will also transfer over the domains

- If you are trying to get a new schema into a feature dataset, you will need to copy and paste the source feature class as a standalone FC into SDE, then again copy and paste that FC into the feature dataset, it will have a name like _1 at the end. Delete the standalone feature class, then rename the feature class in the feature dataset by removing the _1.

Brian
RandyBurton
MVP Regular Contributor

Another option might be to use a combination of List Domains and Create Domain to copy and create the domains.  These tools are available in both Pro and Desktop.  There are some related tools mentioned on these help pages that work with the range or coded values.

0 Kudos
NobbirAhmed
Esri Regular Contributor

You can use Copy tool (in Data Management toolbox) to Copy the Geodatabase with domains to a new geodatabase:

arcpy.management.Copy("gdb_with_domains", "gdb_with_no_domains")

Or, use the Copy tool in dialog:

Answer by Joe Borgione ChampionMar 10, 2015 8:43 AM - is also very good.