I am working with ArcGIS Server 10.5.1 and our server environment structure looks like this:
Arcgis server A
DB Server- A DB
Say A, B C Arcgis server might represent to Dev, Preprod and Prod ArcGIS Servers and they are having their respective enterprise Databases registered properly.
I am going through below mentioned help document to publish services across all the environments:
Which says "
Create connection-neutral SD files (choose the No available connection option in the Save a Service Definition wizard) so they are flexible enough to be published on any server. When you publish an SD file, ArcGIS Server automatically corrects the paths written in the SD so that your server paths are used. Careful data registration allows you to deploy the same SD file in multiple environments.
My understanding: 'If I create 'Connection neutral - connection less service definition file' then I can use same file to publish service on different ArcGIS servers such as Dev, preprod and prod' and as the data(datasource from MXD) is already registered with ArcGIS server, while publishing, dynamically it will get replaced and use that registered data that means, when you publish service on dev, dev DB will get used(which is already registered), Preprod DB will get used when I will publish that Service definition on Pre-prod..so on and so forth!
How should I register my data with ArcGIS Server so that, I can use 1 Service definition(SD) file to publish on all A,B,C Arcgis servers so that, Data source(DB) will get resolved to A,B,C DB respectively as per given in above link.
I have also referred following link to understand but not really clear. I think our scenario would be 'E'
Any suggestions to dynamically resolve data sources while publishing?
Hi, how are you? I don’t think you remember me.
From the description that you have shared, you are basically looking for a way to replicate the same data and services on 3 different environments. I have done something like this although it was not the exact same thing.
We had 3 different database set and 3 different arcgis servers in place, all db's were registered with the respective environments, namely development, staging and production. For the db point of view the instance names, user and password were kept the same.
However, instead of using the SD files we published the services to one server and made the desired settings for each service as per the assumed incoming requests and we had simply copied the services to the staging and production environments.
Paths you need to keep in mind: -
This was a standard practice that we used for the one-time migration.
Other workaround would be to ensure that the same map document (and same version of arcgis desktop) and again same db login credentials so that you won't have to keep resourcing them for publishing them in different environments.
I hope this helps!
First of all thank you so much for responding to my query.
I don't want to replicate data, I have same structure what you mentioned- 3 environments with their respective DBs which are registered. From DB point of view- We have same Schema names, Different instance names, same login credentials and ArcGIS service account is having read access to all of these DBs and only 1 ArcMap document is getting used. This process is not going to be one time though.
I will keep in mind the paths you mentioned and try to make something work but I haven't got what you are trying to say in workaround.
I will keep you posted!
First, it's important to point out that moving directories around to different Server sites is not supported and Technical Support won't be able to provide assistance if issues arise after moving directories manually.
In regards to your question, I believe the connection-neutral SD statements assume you'll use the same connection string, from the instance name to the schema and user. The publishing process will look at the connection string to determine if that connection string is registered as a data store. What you may want to do is use the arcpy.mapping module to update the connections to data and create the SD files for each database in a loop:
for db in ['db1','db2','db3']:
< update path to data using db connection >
< create SD file >
Is there a way to avoid creating SD files for each db connection? i want to use the same SD file across environments, if possible, in a way, that it dynamically replaces or corrects the data source coming from respective DB.
Have you managed to use a single SD file for publishing services in multiple environments? Please let me know if you have managed to resolve it, I am very much keen on it.