Numerous organizations utilize ArcGIS Server services within ArcGIS Online. These services play a crucial role in powering various web maps, applications, dashboards, and story maps. There may be a time when an organization needs to update the ArcGIS Server URL. For example, an organization may need to change ags.domain.org to ags.domain.gov. Below are scripts that will iterate through an ArcGIS Online's organization and update the URLs in:
- referenced services
- Web Maps
- Web AppBuilder applications
- Instant Apps
- Experience Builder applications
- Dashboards
- Story Maps
There are two scripts:
- Update DNS for AGOL Content.py
- Logger.py
The Logger.py performs the logging duties, and simply needs to reside in the same directory as the Update DNS for AGOL Content.py script. A directory called logs will be created with an AGOL Content Update Log File.txt file when the script is executed. Any content that was unable to be updated will be written to the log.
The Variables section of the script is the only portion that will need to be updated:

Variable | Description |
username | AGOL Administrator Username |
password | AGOL Administrator Password |
oldDNS | The portion of the URL to replace |
newDNS | What to replace the URL with |
Additional Notes: I recommend testing on an in individual user first. To do so, uncomment line 77 and specify the AGOL username.
