I thought I could use the
arcpy.env.overwriteOutput = True to overwrite the existing datasets within my target SDE "JeffCoGIS.sde"; however, I get an error that states:
ExecuteError: ERROR 000260: Failed to copy Database Connections\GISData.sde\GISData.DBO.GIS_Dept into Database Connections\JeffCoGIS.sde\GISData.DBO.GIS_Dept
ERROR 000260: Item with the same path name already exists.
Failed to execute (Copy).
I am new to python and couldn't find any help in ESRI Resources on how to overwrite the datasets. Some have mentioned to use replication; however, for our particular workflow, we need to pursue overwrite and copy, if I can get it to work.
Is there a different tool I should use?
If I run this script on the empty SDE, it works fine - just when trying to overwrite the existing datasets.
#Name: Copy_JeffCoGIS_Rev2.py #Copy all datasets including the feature classes within each dataset from # SDE database "GISData.sde" to SDE database "JeffCoGIS.sde" import arcpy arcpy.env.overwriteOutput = True arcpy.env.workspace = "Database Connections\\GISData.sde" fcList = arcpy.ListDatasets() #print fcList for dataset in fcList: arcpy.Copy_management(dataset, "Database Connections\\JeffCoGIS.sde\\"+ dataset)