PROBLEM
Renaming service name via ArcGIS Enterprise portal item details page only updates the title, leaving the original service name and REST URL intact. Howver renaming via the ArcGIS Server Admin endpoint (using renameService at Server admin home > services > Hosted) successfully changes the service's name and URL, but it corrupts the connection to the original item in the ArcGIS Enterprise portal, and the following error is received in Map Viewer:
"Unable to add layer States."

Changing a hosted feature service's URL requires using the renameService operation from ArcGIS Server Administrator endpoint (Home > services > Hosted) generates a new URL, but the corresponding service item in the ArcGIS Enterprise portal becomes corrupted and fails to load in the Map Viewer.
In this example, the original URL is:
https://.../server/rest/services/Hosted/States/FeatureServer

After using the renameService operation shown in the image below,

the renamed service URL is as follows:
https://.../server/rest/services/Hosted/StatesRenamed/FeatureServer

Article ID: 000039067
Get help from ArcGIS experts
Start chatting now