Republishing/Restarting services after database connection password change

2348
7
Jump to solution
08-01-2018 04:23 AM
Clint_Glover
New Contributor III

I currently have several database connections that are used in various MXDs that are used to publish my map and feature services.  I recently had to change the passwords for all of those database connections, and thus there is a need to update all of the layers in the MXDs with the updated data source information.  In this situation, once the layers in the MXDs are updated, will the web services need to be republished or simply just restarted?  I feel like the services would need to be republished for the changes to be reflected, but I've never done this before so I just wanted to make sure I was doing it correctly.  For reference, I am currently using ArcGIS Server 10.5.1 and my database connections are Oracle.

0 Kudos
1 Solution

Accepted Solutions
RandallWilliams
Esri Regular Contributor

Yes - Ideally, you'd have a script that can loop through a directory of map documents and update the workspace paths. Here's an example:

developer-support/python/arcpy-python/find-and-replace-data-sources-in-mxd at master · Esri/develope... 

View solution in original post

7 Replies
RandallWilliams
Esri Regular Contributor

Depending on the version you're working with, the tool you're looking for is 'Externalize Connection Strings'.

If you want the ability to update passwords in registered and managed database connections used by existing services, run the ExternalizeConnectionStrings.bat command utility to update existing service connections.

Register your data with ArcGIS Server using Manager—Documentation | ArcGIS Enterprise 

0 Kudos
Clint_Glover
New Contributor III

So if I am reading that right, the ExternalizeConnectionStrings.bat command utility only needs to be run if you are upgrading from 10.3 to 10.5 or 10.6?  We recently upgraded from 10.4.1 to 10.5.1, so we should be able to just log in to Server Manager and update the Data Store connection files.  I think that should work for us to get our services updated.

Another question I have is what is the quickest/easiest way to update the data sources' connection information for layers inside of MXDs.  We currently have used ArcCatalog, right clicked on each MXD and updated the data sources.  We are also aware of the Arcpy script utlizing the findAndReplaceWorkspacePaths method that does basically the same thing.  Are these two the only real options for updating data souces after password updates?  We have a significant number of MXDs that will need to be updated and our Oracle passwords are set to be updated every 60 days so we would like to find the most efficient method possible.  

0 Kudos
MichaelVolz
Esteemed Contributor

Does your org not allow for special service accounts where the password does not need to be updated for applications such as ArcGIS Server (AGS) where this password policy makes admin of AGS more difficult?

0 Kudos
Clint_Glover
New Contributor III

Yes that is exactly what we had been doing in the past.  Our accounts used for making our map services have never been changed since I started working in our GIS group.  We recently upgraded to Oracle 12c on our lower environments, and since then we were told by our management that we have to change our passwords (now required to be 18 characters) every 60 days.  We are in the process of trying to get an exemption to this rule, but I was tasked with finding a solution to this issue if we were not granted an exemption.  I agree this makes it a nightmare for us to support and administer, especially with numerous accounts for development, acceptance, and production environments.

0 Kudos
RandallWilliams
Esri Regular Contributor

Yes - Ideally, you'd have a script that can loop through a directory of map documents and update the workspace paths. Here's an example:

developer-support/python/arcpy-python/find-and-replace-data-sources-in-mxd at master · Esri/develope... 

Clint_Glover
New Contributor III

Thanks for the help and the resources.  I think we will try incorporating this script into our workflow for the future.

0 Kudos
JoshBillings
Occasional Contributor II

Hey @RandallWilliams.

I realize this is an old thread but I am encountering the same issue in ArcMap 10.8.

After a password change, all data sources that use the SDE connection in my .mxd are broken. I want to update the data sources with the new password using a script using the findAndReplaceWorkspacePaths(oldConnection, newConnection) function. I am using the same username for the old data sources and the new data sources, but an updated SDE connection file.

It seems that when I try to open the .mxd via arcpy.mapping.MapDocument(path_to_mxd), it is locking my database account due to too many failed login attempts.

Would you happen to have an idea on how to resolve this?

Thanks,

Josh

 

0 Kudos