Copying domains from one GDB to another

18467
16
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,

16 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 Alum

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.

by Anonymous User
Not applicable

Is this possible with Pro now? I've created 3 new feature classes with domains & subtypes in the default gdb of my Pro project. Now that I'm happy with the data I would like to import it into SDE with the domains and subtypes. Bonus points if I can transfer over my attribute rules too 🙂 

0 Kudos
mody_buchbinder
Occasional Contributor III

Copy & paste the layer should take the domains too (if they do not exists in target db).

In fact an easy way to copy domains is to create dummy layer that uses them, then Copy & paste this layer to the new db. Later you can drop the dummy layer but the domains will stay.

 

Have fun

0 Kudos
JianT
by
New Contributor II

I'm using ArcGIS pro 2.9.5, I tired to copy dummy feature class from source File Geodatabase to another File geodatabase or SQL Server Geodatabase, however all failed to copy the domains from source feature class to target geodatabase.  Any suggestion? 

0 Kudos
by Anonymous User
Not applicable

I didn't realize that copy/paste was an option for feature classes in a geodatabase! What's the point of the import/export function then?

I see a bit of a problem with copy/paste - my attribute rules were set up to run on a Copy of a feature class (i.e. Roads_Copy) that exists in my project's default GDB. The copy/paste method will not allow me to add feature classes with attribute rules that are invalid in the SDE database (i.e. the attribute rules need to reference the Roads feature class but I don't think I can save the attribute rule in the default gdb with an invalid attribute rule) 

0 Kudos