Overwrite existing hosted feature service

1435
2
01-09-2019 11:52 AM
JulieMikolajczyk3
New Contributor III

I'm using the process outlined here: FeatureSharingDraft—Sharing module | ArcGIS Desktop  and am getting an error that the layer already exists. ExecuteError: ERROR 001398: Service name 'WolfTelemetryDataOnline' already exists.
Failed to execute (UploadServiceDefinition).

I've tried adding in this parameter, but it still fails: arcpy.env.overwrite_existing_service = True

Is there a way to overwrite a hosted feature service from arcpy, or should I stick to using the Python API for this using sdItem.publish(overwrite = True)?

2 Replies
KatieCullen
Regular Contributor II

There is a code sample at the bottom of this doc that should overwrite a service:

Stage Service—Help | ArcGIS for Desktop 

JaredPilbeam2
MVP Regular Contributor