Select to view content in your preferred language

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

7407
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
JonathanQuinn
Esri Notable Contributor

You can look into externalizing the connection strings and then updating the data store within Manager:

Upgrade ArcGIS Server—Documentation | ArcGIS Enterprise 

The link title is misleading.  It's supposed to be for password changes but should work for hostname changes.

JoëlHempenius3
Frequent Contributor

Thanks 🙂

I think I can test this very easy: I will modify the host file in Windows on my ArcGIS Servers and on my ArcGIS desktop machine. In the host file I will put a new hostname for the existing Oracle host and generate  new SDE files files. I will update the SDE files at my ArcGIS Server and follow the instructions you linked. 

Hopefully, it will work for my managed datasource as well.

-Joël Hempenius.

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

I need to upgrade our database connection as well with a new instance name. Were you able to update your existing web services with the External Connections Strings tool?

0 Kudos
JoëlHempenius3
Frequent Contributor

Yes, this worked for updating the instance name.

The old instance name however sticks in the connection name when you look in the Service Workspace. When you select the connection name and look at the Workspace Properties, the connection properties and server show the new instance.

Another issue was that the Externalize Connection string tool crashed a couple of times for unknown reasons. I therefore ran the tool until it completed with exit code 0.

Make good backups of your Arcgis Server configuration and database, I did not need them, but you never know what can go wrong.

-Joël Hempenius.

Languages: JavaScript, Python and Dunglish
JuneAcosta
Frequent Contributor

Thanks for responding.

I get the error “Update failed” for every service that was reported back from the ExternalizeConnectionString tool. When I look at the workspace I still see the old instance name. I also restarted one of the services hoping it would use the new connection, but I get this error “ Service started with errors

pspPoliceBeat.MapServer:

Instance of service 'pspPoliceBeat.MapServer' started with errors. The Layer:'pspPoliceBeat' in Map:'Police' is invalid. The base table definition string "gisdata.SDECB.PoliceBeat" is invalid. The item was not found.

Did you use ArcPro to publish your services? Did use the same sde connection file and just modified the instance name and re-import the connection file in the data store page?

0 Kudos
Martin1
Frequent Contributor

@JoëlHempenius3 Thank you for sharing your experiences here. I am facing the same question and followed the same path as you, by editing the Data Store connection and applying a new SDE-file. 
Now I also see the new connection there, but for every single service I still see the old server name, etc. 
Did you verify, that in fact the services use the new connection even though they show the old information? 

0 Kudos
JoëlHempenius3
Frequent Contributor

Well, it's a long time ago, so I don't remember this anymore. But I probably did some verification. All database systems can report the active connections, and how they are connected. ArcGIS Pro can read this information. So probably I would connect to the old database with Pro with the SDE superuser and review the active connections and do the same thing with the new database. If you cannot do this, ask your DBA to review the active connections on the databases. 

-Joël Hempenius.

Languages: JavaScript, Python and Dunglish
Mehretab
Frequent Contributor

Looks the is a solution for changing a password and host  name , but I am looking to update my connection into a new oracle user that is the same host but different Oracle user.

Our old Oracle user got read only permission and in 10.6.1 such user is not supported (BUG). Why are Esri forcing us to have a user with read and write permission is another question. And the easiest solution as stated in the BUG is  to give the user a full permission but this user is called by many other application indipendent of our ArcGIS server services.  So given it a full permission is not an option.

The quesion is, is it possible to change the user name (ofcurse different password but the same host name) of my ArcGIS server service connection?

thanks!

0 Kudos
JoëlHempenius3
Frequent Contributor

All my mapservices were published using ArcMap.

If I remember correctly did the following steps:

Using the old database, I ran the  ExternalizeConnectionString tool from the command line until it successfully finished.

The Database administrator then moved all the data to the new instance

I updated the SDE files for the new instance.

With these new SDE files I updated my registered databases on ArcGIS Server

Restarted the ArcGIS Server to force a restart of all mapservices

All mapservices started without error.

-Joël Hempenius.

Languages: JavaScript, Python and Dunglish