Is it possible to use Python to stop the ArcGIS Service so you could successfully delete a FGDB with running map services completely and copy a new one in it's place with same name. See the attached image for what I am referring.
Solved! Go to Solution.
This has nothing to do with esri libraries.
You can do it with standard python libraries.
For example: https://stackoverflow.com/questions/46595845/python-command-to-stop-and-start-windows-services
I have a script that takes the machine out of load balancing, stop the service, replace directories (FGDB is just a directory) and then return everything. The script must run on the machine itself in order to take it out the load balancing.
Sorry I cannot share it but it is very simple.
Have fun
How about a truncate and append of feature classes in the FGDB so the services would not need to be stopped?
That is what we are doing now. This is a dual Server setup for load balancing and the objectIDs do not match after the truncate and append script runs on each Server . This was not an issue until we started using the feature service in an AGOL application. The AGOL app must cache the ObjectID and if you identify another feature after an initial identify the different ObjectIDs cause strange behavior.
You can do it through the ArcGIS Python API. Check out the arcgis.gis.server.Service section of the docs, where you'll see start and stop are both methods. So you could have a script stop the service, do whatever, then start it back up.
Thank you I will check this out and let you know if this solves the problem. I appreciate the response.
This has nothing to do with esri libraries.
You can do it with standard python libraries.
For example: https://stackoverflow.com/questions/46595845/python-command-to-stop-and-start-windows-services
I have a script that takes the machine out of load balancing, stop the service, replace directories (FGDB is just a directory) and then return everything. The script must run on the machine itself in order to take it out the load balancing.
Sorry I cannot share it but it is very simple.
Have fun
Thank you I think this is what I am after. I appreciate you taking the time to answer.