Easy way of copying geodatabase schema to a different feature class

10758
20
Jump to solution
06-04-2018 07:05 AM
AdrianWelsh
MVP Honored Contributor

I feel like I'm having a GIS brain fart where I can't remember how to do this easily.

There is a certain 'schema' I use for a set of feature classes (like number of fields, the field names, field types, and some domains) that I want to 'copy' into a brand new feature class. This new feature class only has features that were imported from CAD. What's the best way about turning my newly created feature class into a shell of what I want it to be? Does that make sense?

ArcGIS Pro 2.1.3

Geodatabase

20 Replies
AdrianWelsh
MVP Honored Contributor

Well, that sounds like good fun! I appreciate your help and look forward to 2.2.

0 Kudos
SiranErysian2
New Contributor III

Hi Jonathan, 

I am trying to do the same as Adrian above (In Arc Map 10.5) and I can import the schema to a new feature class and it works fine, I can get all the fields because I exported the xml workspace from a previous geodatabase. BUT I do not get the domains as Melinda mentions below. I exported schema only. Is there a step I missed? I'd like to import all the domains I created as well as the fields for a new geodatabase

0 Kudos
JonathanFarmer_oldaccount
Occasional Contributor III

Hi Siran,

I'm not sure why it doesn't seem to work in your environment. I just tested this on my end using 10.6.1 and the domains were included in my import. You might try one more time?

If it still doesn't work, let us know your steps and maybe that will help. You could also contact Technical Support at 888-377-4575 if you'd like to work with someone here on it.

0 Kudos
SiranErysian2
New Contributor III

Ok I will do that. Thank you.

0 Kudos
JulieMikolajczyk3
New Contributor III

I just found out about the lack of domains coming over from the create new feature class wizard. That was not mentioned in the documentation. I figured using a field template would bring the domains in as well.

0 Kudos
SiranErysian2
New Contributor III

Julie,

So the template doesn’t bring in the domains? I haven’t tried it.

Siran D. Erysian, M.A., GISP,

Research Analyst II – GIS

Think Spatially

Department of Water Resources

3374 E. Shields Ave, Rm. A-1, Fresno, CA 93726 (559) 230-3312

Siran.Erysian@water.ca.gov

0 Kudos
JoeBorgione
MVP Emeritus

Not exactly 'easy' (but that's all relative, right?!) but  you could create a python script that utilizes arcpy.ListFields, and then loop through that list and add fields to the existing feature class:

ListFields—ArcPy Functions | ArcGIS Desktop 

Field—ArcPy classes | ArcGIS Desktop 

Add Field—Data Management toolbox | ArcGIS Desktop 

That should just about do it....
AdrianWelsh
MVP Honored Contributor

Oooohhh... tasty!

Next time I will try that.

0 Kudos
MelindaBrown1
Esri Contributor

Another option for creating new feature classes from an existing schema, that should retain domains, is to use the Import / Export XML Workspace tools. Try right-clicking a feature class from within the Catalog pane > Export > Feature Class(es) to XML Workspace Document. Under Export Options, you can choose 'Schema only'. To create the new empty feature class with this schema (including domains), simply right-click the geodatabase of interest from within the Catalog pane > Import > XML Workspace Document, which launches the similarly named gp tool. Select the recently created XML for the Import file and choose to 'Import schema only.' 

Export XML Workspace Document—Data Management toolbox | ArcGIS Desktop 

Import XML Workspace Document—Data Management toolbox | ArcGIS Desktop 

Note: These are only available with a Standard or Advanced license.

AdrianWelsh
MVP Honored Contributor

Melinda,

That is very helpful! Thanks for the info on this. I will certainly try exporting/importing the XML info next time as it seems like this maybe even a more streamlined process than what's discussed above. It's good to know about the licensing as well - I appreciate you including that.

Thanks!

0 Kudos