Select to view content in your preferred language

Move feature class from dataset A to dataset B in database

3725
7
Jump to solution
02-10-2021 02:19 PM
forestknutsen1
MVP Regular Contributor

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/...

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/590...

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.

0 Kudos
1 Solution

Accepted Solutions
BlakeTerhune
MVP Regular Contributor

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.

View solution in original post

7 Replies
BlakeTerhune
MVP Regular Contributor

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.

DanPatterson
MVP Esteemed Contributor

As @BlakeTerhune says... any "move" isn't really a move, it is move-like but the details are hidden for most


... sort of retired...
forestknutsen1
MVP Regular Contributor

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 😒

0 Kudos
mody_buchbinder
Frequent Contributor

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.

0 Kudos
forestknutsen1
MVP Regular Contributor

Right Thanks

0 Kudos
Cristian_Galindo
Frequent Contributor

Hi, 

did you tried to check your theory? any results?

0 Kudos
forestknutsen1
MVP Regular Contributor

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 🙂