arcpy overwriteoutput

780
3
08-24-2017 08:47 AM
Highlighted
New Contributor

I have some scripts that we use in our office to backup our gdb onto our backup server. I checked them the other day and some are failing saying that the data already exists. I have overwriteoutput = true, so I am not sure why it is not overwriting the data. I am attaching a screenshot of the script and the error. Any help would be greatly appreciated.

KevinPython script and error message

Reply
0 Kudos
3 Replies
Highlighted
MVP Esteemed Contributor

As Dan Patterson‌ points out in Regarding arcpy.overwriteOutput Property , "OverwriteOutput will only overwrite if it can."  You are working with SDE/enterprise geodatabases, so you will need to dive deeper to see whether the feature classes and feature datasets you are trying to override are in use, whether the permissions allow them to be removed, etc....

Highlighted
MVP Esteemed Contributor

SDE again eh

Reply
0 Kudos
Highlighted
Regular Contributor

Hi Kevin,

I would try examining the geodatabase locks by right-clicking the SDE connection and going to Administration > Administer Geodatabase and then looking at the locks tab. This could give you some info about what users/processes are locking your output feature class.

Also, does running your script without declaring all those local variables make a difference? I have heard that creating a variable pointing to a feature class can lock it up because the variable represents a pointer from python exe. Just a thought.

You might also be able to make use of the TestSchemaLock—ArcPy Functions | ArcGIS Desktop function to test whether you can get an exclusive schema lock on your target dataset.

Good luck,

Micah