24

Sometimes I have the need to copy a domain(s) from one geodatabase to another (without the featureclass or table).

In the past, I have accomplished this in a few different ways, but each method is not as straightforward as I think it could be (or maybe there's a CopyDomain tool that I've missed).

What method do you use to accomplish this?

3
  • I know of at least 2 additional methods: maybe not "accepted answer" worthy, but definitely reputation worthy. I'll post them in a few days if no one else provides them as answers. Commented Nov 12, 2010 at 13:10
  • Do post the additional solutions, the community will vote up if they are worthy :) Commented Nov 13, 2010 at 13:58
  • On several occasions I've had to explain to non-GIS DBA's how domains are like a table, but are not stored as a table that can be accessed through SQL. Maybe answers to this should be in language a non-GIS DBA can understand. Commented Nov 15, 2010 at 15:24

5 Answers 5

16

For coded value domains, I'll do a Domain To Table from the source geodatabase and then do a Table To Domain into the new geodatabase.

I don't know of a way to this for the range domains. You can do a Domain To Table, but the Table To Domain always comes in as a coded value domain.

1
  • 3
    I just used the Domain to Table and Table to Domain tools this morning and they worked great. Commented Mar 7, 2012 at 14:49
10

http://arcscripts.esri.com/details.asp?dbid=14729

This is an ArcCatalog Extension that allows you to copy domains between geodatabases.

I believe it is only up to date for 9.3.1 SP1, so it may not work with ArcGIS 10.

4
  • +1 I am on ArcGIS 10, but I deliberately left the question open to any version. I did get the 9.3.1 extension to work in ArcCatalog 10. I didn't get the new command on the context menu, but I was able to add the command to a toolbar and use it that way. Commented Nov 10, 2010 at 15:14
  • Ok, glad that worked. You should let the extension author know about the context menu command not working in ArcCatalog 10. Commented Nov 10, 2010 at 15:21
  • I did notify the author (crickets so far). Also, I applied SP1 to ArcGIS 10 on friday. Now the copy domains arccatalog extension errors when ArcCatalog starts up. Commented Nov 15, 2010 at 12:58
  • That makes sense, hopefully he'll update it soon. Commented Nov 15, 2010 at 14:29
3

This method is more hacky and only practical for 1 or a few domains.

  1. In the original geodatabase, create a dummy featureclass with a dummy field that matches the field data type of the domain that you wish to copy.

  2. Copy/Paste the dummy featureclass into the new geodatabase and don't delete it until you've assigned the domain to a field in another featureclass.

3

I wrote a quick command line arcobjects exe based on some vba code that I found last week. It's not complicated code.

Exe is here.
AVI movie here.

Fine print: The exe is compiled to 10.0 / ArcEditor license (the license is part is hard-coded for now).

alt text

2
  • I tried this out but I get exception errors, CopyDomain.exe canvec_blank.gdb target.gdb * Exception from HRESULT: 0x80040228 Exception from HRESULT: 0x80040228. Any ideas? Commented May 31, 2011 at 21:41
  • Don't know for sure, but are you an ArcEditor license? That was a quick&dirty tool, so it's probably not the most elegant tool. Do you have Visual Studio? The source is here: code.google.com/p/umbriel/source/browse/… Commented Jun 1, 2011 at 2:01
3

Here's a method to export/import domains that uses XML Workspace Documents.

Requirements

  • ArcGIS Desktop 10.X.X
  • ArcGIS Pro latest (tested)
  • Notepad++, Notepad, or your favorite text editor

Procedure

Export XML from Source

  1. Select your source geodatabase
  2. Export an XML Workspace Document

export

  1. Export the schema only. Metadata is optional (red arrow).

schema only

Edit XML

The dataset schema is deleted in the step.

  1. Open the XML file.
  2. (optional) Turn on word wrap to make everything easier to see.
  3. Delete everything between the <DatasetDefinitions xsi:type='esri:ArrayOfDataElement'> and the </DatasetDefinitions> tags. It should look something like this:

xml edits

  1. Leave everything else alone.
  2. Save the XML file

Import to Target

  1. Find/Create the new geodatabase
  2. Import the XML Workspace Document...
  3. Select the edited XML and go.
  4. Done.

Troubleshooting

  • The Esri XML workspace specification is very specific. If the import step gives an error, there is probably a schema error. Review the XML or just export it again and repeat. Don't remove any extra carets or line breaks.

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.