Select to view content in your preferred language

Move feature classes out of feature dataset

6337
17
Jump to solution
11-27-2019 10:03 PM
OlovMelin
New Contributor II

hello!

I have an enterprise geodatabase with a number of feature datasets. Every feature dataset has a number of feature classes and relationship classes. The relationship classes are pointing to feature classes in the same feature dataset but also to feature classes in other feature dataset in the sama geodatabase.

The geodatabase is used by ArcGIS Server, FME and various scripts that we don't want to remake.

Is there a method or way to move all feature classes and relationship classes to the root of the geodatabase? I know that it doesn't matter for the arcgis server and FME if the feature class is in an feature dataset or the root, it will find it anyway. However, I have big time issues with moving/copying this relationship classes. If I simply use the method of copying data with new name -->delete old files and rename the new, the relationship classes will stop working.

Is this an dead end? Better to delete all reationship classes, move data and make new ones?

0 Kudos
17 Replies
AllanBenvin_yyc
New Contributor III

Did you have any luck with this? We have many layers within feature datasets in our production databases from the olden times. In my testing I found that if I move layers outside of the feature datasets all the MXDs and APRXs still work but they still reference the FDS. If I remove the now empty FDS from the database, all the map documents will break.

On a related note I am also hoping for a way to be able to move, not copy layers in/out of an FDS using arcpy. All the posts I have found refer to making a copy. This isn't feasible in our situation as it plays havoc with relationship classes, domains, archives etc. In the past we had to write a little ArcMap SDK executable that would do this. Since we have things like attribute rules now this won't work. An arcpy solution would be the best.

 

0 Kudos
Cristian_Galindo
Occasional Contributor III

Hello, 

 

How can I reproduce the drag nd drop behavior programmatically? I have seen several post about copy, delete, rename operations, but it is not the same result as drag and drop.

0 Kudos
Marshal
New Contributor III

Hi Angela,

Did you ever figure out how to remove the feature dataset attribute from a layer's CIM connection properties?

Thanks!

Marshal

0 Kudos
AngelaDeegan
Occasional Contributor

I'm afraid I didn't. Ended up doing it manually. It was a pain. And when I deleted the empty feature datasets, the layers corresponding to feature classes that had been in those feature datasets stopped displaying in the web map that had been published. So we had to re-publish the services.

Hope that helps. This was a couple of months back, so it's getting fuzzy already!

0 Kudos
Marshal
New Contributor III

Thanks for the response and update!  I broke lots of projects moving data out of feature datasets recently, so I was struggling with this.

I did finally come up with a solution which I describe in my post below.  Although my situation was pretty straight forward since all layer connection info (feature class name, database location, database name) was the same except removing from the feature dataset, but maybe it can help if you run into this again.

https://community.esri.com/t5/python-questions/remove-featuredataset-attribute-from-layer-cim-connec...

Thanks again!

 

0 Kudos
Bud
by
Honored Contributor

For anyone who's interested, here's a GIF that demonstrates an FC being moved in and out of an FD by dragging and dropping in Catalog (ArcGIS Pro 2.6.8):

Drag-and-drop FC in and out of FD - V2.gif

0 Kudos
AllanBenvin_yyc
New Contributor III

Just wondering if you found a programmatic way to fix the reference to feature datasets in existing MXD/APRX documents.

We have a whack of layers in feature datasets and want to move them out. it seems we can move them out of the FDS but if we delete the FDS then we break everything. We have over a thousand users with map documents all over the place.

0 Kudos
Marshal
New Contributor III

Yes, I was able to use the concept and code from my post below to repair APRX documents.  The missing part would be use os.walk to find APRX documents, check if they have broken data connections, and add them to a list of documents to be repaired if so.

My case was a single geodatabase with a single feature dataset.  So if you are talking about multiple geodatabases and multiple feature datasets it will take a bit more setup to have the correct templates for each scenario.

https://community.esri.com/t5/python-questions/remove-featuredataset-attribute-from-layer-cim/m-p/10...

Hope it helps!

0 Kudos