Is it possible to move a feature class with arcpy from one dataset to another?
There is this thread:
https://community.esri.com/t5/data-management-questions/move-feature-classes-out-of-feature-dataset/m-p/163438
That talks about the drag and drop option. There is a code example but it does not look like a working solution.
There is also this thread:
https://community.esri.com/t5/python-questions/arcpy-move-feature-class-into-feature-dataset/m-p/590134#M46276
It talks about using Feature Class to Geodatabase. But this appears to just create a new copy of the feature class in the target dataset.
You'll need to use copy and delete to perform a "move" operation like you describe. If the two datasets have different coordinate systems, you'll first need to project the data.
I did not. I chickened out. I needed a process that I could use in production. So, I was risk risk-averse. Let me know if you give it a go 🙂
Hi,
did you tried to check your theory? any results?
Right Thanks
Hi
If you do not want to move relates then the best way is to create identical new feature class at target db then use Append to transfer data only.
Then if you Delete from source db the relations will be deleted but not the tables that the relations pointing to.
Okay, that is what I feared. The feature class has a number of relationships, so it will be more work than just a straight forward copy and delete. I first have to delete the relationships and then rebuild them after. All doable...
On a side note, I wonder if Esri is really copying, deleting, and rebuilding relationships with ArcObjects. I suspect they are just tweaking the database metadata tables like updating the sde.gdb_items table. I am tempted to test in the dev environment. But it is too risky when I go to production 😒
As @BlakeTerhune says... any "move" isn't really a move, it is move-like but the details are hidden for most
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.