Select to view content in your preferred language

I want to update all mapservice connections on Arcgis for Server 10.5.1

7694
12
11-29-2017 04:16 AM
JoëlHempenius3
Frequent Contributor

Our current Oracle database has to be migrated to another host. The new host already contains a couple of databases, so it isn't possible to maintain the same hostname. 

The Arcgis Server mapservices data connections therefore need to be updated to connect to the new database. Is there functionality in Arcgis Server 10.5.1 to update all connections at once or to update a connection for a mapservice?

The alternative is to republish all mapservices. I can write a python script to get the security and mapservice settings as json, get the MXD files from the server directory, update the MXD data connection, generate SD and republish the SD using the stored json settings, but this will take more time and might be more error prone.

-Joël Hempenius.

Languages: JavaScript, Python and Dunglish
0 Kudos
12 Replies
JuneAcosta
Frequent Contributor

I ran the ExternalizeConnectionString after I updated the datastore with the new sde file. I thought I was suppose to run the tool after I update the sde file with the new instance.

Thanks for listing your steps.

0 Kudos
JoeGuziStarkCountyOH
Frequent Contributor

Does anyone understand what the ExternalizeConnectionString tool actually does. After reading the steps provided by  Joël Hempenius I think I have an understanding, but I would feel a lot better if I knew what it did. Thank you for everything and have a delightful day.

Sincerely,

Joe Guzi

0 Kudos
JoëlHempenius3
Frequent Contributor

The older versions (10.3.1) of ArcGIS for server did not use the connections in de Data Stores for the services. The connections there were only used to check if the server could connect to the database when publishing a service from Arcmap. I used Arcpy scripts for publishing and could publish services with enterprise geodatabase connections which were not registered at all. The connection was possible and the services worked fine without any connection in the Data Store. Big downside was that when you had to change a database user password you had to republish all the services with the new password. Forget one service, restart something and the database user gets locked. 
With modern ArcGIS Enterprise systems (10.7), you cannot publish a service from Arcpy when the database connection in ArcGIS Pro or Arcmap has not been registered with server. I think therefore by default the services now use the database connection from the Data Store instead of the connection provided by the Mapx. 

The externalizeConnectionString tool helps you migrate from the old way of storing the connections in mapservices to the new way of  pointers to the Data Store.

-Joël Hempenius.

Languages: JavaScript, Python and Dunglish