Script to find ArcMap Runtimes in ArcGIS Server

1554
6
Jump to solution
03-28-2023 10:37 AM
RogerDunnGIS
Occasional Contributor II

I have ArcGIS Pro 2.9.5 installed on my desktop.  I have ArcGIS Enterprise 10.9.1 installed on our server.  I have administrative access.  Please help me find a way, in Python, to list all services that use the ArcMap runtime, in preparation for our upgrade to Enterprise 11.  Here is what I have so far:

import arcgis, arcgis.gis.server
admin_user = "admin"
admin_pass = "abc123" # Heaven forbid
portal_url = "https://my.organization.org/portal"
server_url = "https://my.organization.org/server"
our_portal = arcgis.GIS(portal_url, admin_user, admin_pass)
our_server = arcgis.gis.server.Server(server_url, gis=our_portal)
content_mgr = our_server.content
folders = content_mgr.folders
# Obviously, I'll loop through folders and services once I get the test right
known_arcmap_service = content_mgr.get("xyz") # xyz is in the root
known_arcpro_service = content_mgr.get("abc", "folder")

 

I have tried accessing several properties of both known_arc*_service objects, and cannot find any indicator in Python as to which one uses the ArcMap runtime and which uses the ArcPro one.  Therefore, I can't programmatically find them.  We have hundreds of services and it would be great to do this programmatically and not by loading 10 items at a time in ArcGIS Server Manager.

If there's another way to do this in Manager, then let me know, or any simple way to query which services use the ArcMap runtime would suffice.  Thank you, community!

 

1 Solution

Accepted Solutions
jill_es
Esri Contributor

Hi @RogerDunnGIS, I know you're looking to gain this information for your ArcMap-based services via Python but would the UpdateArcMapServices utility help you in this instance?  Analysis mode would provide an inventory of your services without migrating them.  This blog also goes into a bit more detail about this.

View solution in original post

6 Replies
RhettZufelt
MVP Frequent Contributor

ArcMap vs ArcPro runtime?  Are you trying to find out which services were published using which software package or something else?

If so, could loop through the arcgisinput folder (C:\arcgisserver\directories\arcgissystem\arcgisinput) and look for *.mxd files vs *.mapx files.

R_

RogerDunnGIS
Occasional Contributor II

I do have a script that does that, but it pries into the manifest of each service using the arcgis API instead.

What is a .mapx file?  I'm not familiar with that file extension.

However, ArcGIS Server 10.9.1 offers a button in ArcGIS Server Manager that allows a person to convert their ArcMap run-time service into an ArcPro run-time service.  Meanwhile, the source of the service remains the same: an .mxd document.  When you look at ArcGIS Server Manager, it says right there under the service description which run-time it's using; I just don't know why it's been so hard for me to find that piece of data using the API.

RogerDunnGIS_0-1680100553085.jpegRogerDunnGIS_1-1680100609737.png

I did end up getting the ArcMap run-time services by eye, but I want to check back again in a week or two to see if users are converting their services to ArcPro for the version 11 update.

 

0 Kudos
RhettZufelt
MVP Frequent Contributor

Server makes a copy of the map document that the service is published from in the arcgisinput folders.

If it was created with ArcMap, the file will have a .mxd extention.  If created with Pro, will be .mapx extention, which appears to be the same as an .aprx file and opens directly in Pro.

R_

 

0 Kudos
RogerDunnGIS
Occasional Contributor II

I appreciate your reply.  I'm aware that Server makes a copy of the original ArcMap document, and that sometimes there are changes to it, like when data is copied to the server.  What I was trying to explain is that you can have an ArcGIS Server service running with the Pro run-time, even though it was originally published with ArcMap.  I explained in the last reply how a user might do that.  Once the conversion is done, the original ArcMap document remains in the folder, and Server Manager will continue to report that the original document was an .mxd, even though a service is running with the Pro run-time.

0 Kudos
jill_es
Esri Contributor

Hi @RogerDunnGIS, I know you're looking to gain this information for your ArcMap-based services via Python but would the UpdateArcMapServices utility help you in this instance?  Analysis mode would provide an inventory of your services without migrating them.  This blog also goes into a bit more detail about this.

RogerDunnGIS
Occasional Contributor II

As a Python programmer, I sometimes forget about other tools available that aren't already in ArcToolbox.  Of course, Esri provides many tools to users and administrators that are only available in some environments, like Command Prompt.  Thank you for your solution.