Move File Geodatabase in ArcPy

951
3
Jump to solution
02-04-2021 10:18 AM
NathanHeickLACSD
Occasional Contributor III

Is there a proper way to move a file geodatabase from one folder to another in ArcPy using ArcGIS Pro and Python 3.7?  If I use arcpy.management.Rename, I get an error saying the workspace already exists.  Changing the folder only works if the name of the geodatabase also changes.  I can also use Copy and Delete, but moving a file geodatabase seems like a fundamental operation that you should be able to do in ArcPy.  Also, the documentation is not very clear about file geodatabases, it talks more about feature classes.

0 Kudos
1 Solution

Accepted Solutions
NathanHeickLACSD
Occasional Contributor III

Technical support got back to me.  They said using Rename to move a file geodatabase is not supported.  I should use Copy and Delete.

View solution in original post

3 Replies
JoeBorgione
MVP Emeritus

What if you just did it straight python; zip it, move it, and unzip it?

That should just about do it....
NathanHeickLACSD
Occasional Contributor III

I thought of that, but I read too many posts recommending to use the software over manually doing it.  Realistically, I do that all the time, so I shouldn't worry about it.  I was just wondering if I was missing something in the software.

NathanHeickLACSD
Occasional Contributor III

Technical support got back to me.  They said using Rename to move a file geodatabase is not supported.  I should use Copy and Delete.