Problem: Unable to publish a service with the same name as a deleted service
After deleting a service from ArcGIS Online, publishing a new service with the same name as the deleted service fails with the following error:
ERROR 001398: Service name <service_name> already exists.
The error occurs when attempting to publish a service with the same partial name of an existing service.
Solution or Workaround
To publish the service, export the service definition file from ArcMap and add as an item to ArcGIS Online. The instructions provided describe how to publish a new service with the same partial name as an existing service.
In ArcMap, click File > Share As > Service.
Select the Save a service definition file option, and click Next.
Select the Choose a connection option, and select an existing connection from the drop-down list.
Enter a service name, and click Next.
Select a location to save the service definition file, and click Continue. The Service Editor dialog box appears.
Set the service definition properties, and click Analyze. Warnings and error messages are displayed in the Prepare window.