Select to view content in your preferred language

Help appending all of the feature classes in one enterprise database to a template enterprise geodatabase using model builder

3079
16
11-16-2021 12:44 PM
MDB_GIS
Frequent Contributor

I am working on moving our GIS data from an old server to a new one. I've created the enterprise geodatabase on the new server, and have imported the schema from the old enterprise geodatabase from the old server. The new server now contains a bunch of empty template feature classes. I now need to figure out the best way to load or append all of the data from the old server into the new one. I have ~500 feature classes to do this for, so I'd prefer not to do it manually. I do not know python well enough to utilize it for this task, so I think my best option is to try and work something out with model builder. Any suggestions?

I'm running into a wall because I can't figure out how to tell model builder to append the data from the old server to the feature class that has the same name on the new server. I feel like I'm missing something with the iterators but I can't quite piece it together.

0 Kudos
16 Replies
MDB_GIS
Frequent Contributor

Ok. So I think that I am getting somewhere. Here is what I have now. 

MatthewBeal_1-1637173148927.png

When I run that, the results window displays the following:

MatthewBeal_2-1637173546767.png

 

The part in red is the full path, which is correct. The feature dataset is OCGIS_2020.DBO.CadastralReference and the feature class is OCGIS_2020.DBO.GeorgiaMilitiaDistricts.

You mentioned that I would need to Parse the path twice. What would the input for the 2nd parse tool be? From there, what would I need to feed into the Append tool?

Additionally, thank you so much for all of your help and patience. I really appreciate it!

0 Kudos
curtvprice
MVP Esteemed Contributor
Example:

First parse path: input: C:\test.gdb\fds\fc output:c:\testgdb\fds
Second parse path input: C:\Testgdb\fds output: fds
0 Kudos
curtvprice
MVP Esteemed Contributor

parsepath.png

The input SDE path above is

C:\Users\mbeal\AppData\Roaming\ESRI\ArcGISPro\Favorites\OCGIS_2020.DBO.CadastralReference\OCGIS_2020.DBO.GeorgiaMilitiaDistricts

The Calculate Value expression I'm using above is:

r"%name (2)%.%Extension (2)%"

which when executed becomes

OCGIS_2020.DBO.CadastralReference

After this you would use Calculate Value like before to assemble the pieces of your path, when it is correct you can use it for Append as you were before, except the path will be correct.

0 Kudos
MDB_GIS
Frequent Contributor

So would this need to be a sub-model? Wouldn't I need to iterate the process so that it loops through each feature class in the enterprise geodatabase?

0 Kudos
curtvprice
MVP Esteemed Contributor
Nope
0 Kudos
MDB_GIS
Frequent Contributor

Hmmm. I will give this a shot in the morning and keep you posted. Thank you for your help again!

0 Kudos
curtvprice
MVP Esteemed Contributor

Sorry, I was in lab and didn't want you to go down that rabbit-hole. 🙂  If you check the Recursive box in the iterate feature class tool, it will iterate through a list of all the feature classes in the geodatabase, the paths will include the full paths which can then parse using the approach I suggested. One iterator should cover all the feature classes in the geodatabase this way, no need for a complicated nested iterator in a submodel.

0 Kudos