Select to view content in your preferred language

Replace a Map Service from MXD by APRX

1728
15
Jump to solution
12-01-2023 02:49 PM
GD2
by
Emerging Contributor

Hi everybody, 

Can we replace a map service that was published on portal using MXD by an APRX project? I mean, when the same MXD is imported to an APRX, can we "Overwrite" the map service on Portal?

Tags (1)
2 Solutions

Accepted Solutions
ShariF
by
Regular Contributor

We imported the mxd into a pro project, kept the same name for the service and then did an overwrite. I did that for over 200 services. Couldn't find any documentation about if that was best practice or not. We haven't had any issues.  I'm curious how others will respond to your questions. Best of luck! 

View solution in original post

cdickerson
Occasional Contributor

I recommend the Python API. Recently we conducted an inventory of everything in our Portal. I was able to use the Python API to cycle through all of our Web Maps and output list of Layers with data sources. 

Here are few lines to get you started. It isn't everything you need in the code but those are the main parts.

gis = GIS(url="PORTAL URL HERE", username="USERNAME", password="PASSWORD")

webmap_search = gis.content.search(query="", item_type="Web Map", max_items=10000)

for webmap_item in webmap_search:
  print({webmap_item.title})
  webmap = arcgis.mapping.WebMap(webmap_item)
  for layer in webmap.layers:
    print(f"- {layer.title if hasattr(layer, 'title') else 'Untitled Layer'}, {layer.url}")

 

 

View solution in original post

15 Replies
DEWright_CA
Frequent Contributor

You have to replace the service from ArcGIS Pro; you can't just drag/drop a APRX over the MXD; you have to publish/replace the service.

0 Kudos
ShariF
by
Regular Contributor

We imported the mxd into a pro project, kept the same name for the service and then did an overwrite. I did that for over 200 services. Couldn't find any documentation about if that was best practice or not. We haven't had any issues.  I'm curious how others will respond to your questions. Best of luck! 

DEWright_CA
Frequent Contributor

I did the same thing; and it worked out pretty well. Only minor issues in some places with large services with Tile-Caches behind them; but overall worked out well.

0 Kudos
MichaelVolz
Esteemed Contributor

I was not able to replicate your workflow by just overwriting an ArcMap mapservice with a Pro mapservice even though that would have been ideal.  I needed to delete the ArcMap mapservice and then publish a new mapservice with the same name from Pro.

0 Kudos
GD2
by
Emerging Contributor

Hi @ShariF I am able to replace the map service on Portal via APRX. However, will this not replace them on web maps that they are in? I am having to replace them on the web maps manually and have to configure the popups again as it didnot honor the previous settings. Is this what you did? if not then, could it be a version issue? I am using version 10.8.1 

0 Kudos
ShariF
by
Regular Contributor

Good question. I don't recall having to do what you are describing in this position but I do recall having to do that at my previous job.  We have arcserver for both Portal and AGOL from which I overwrote the services. Our portal is old (10.7).

I was new to this organization and tasked to republish all services as they were pointing to a defunct geodatabase for both Portal and AGOL. Because of the urgency of needing to point to updated geodatabase, I only did a cursory review of  the web maps/pop-ups . On that note too what I've since seen is hardly any pop-ups were configured (these are things I've been tasked to update/improve as I was hired - default pop-ups are my pet peeve!). 

Redoing pop-ups is such a pain. I wonder if the ArcGIS Online Assistant would help? You can update item URL for the layers in a web map. 

ShariF_0-1701714079737.png

 

 

0 Kudos
GD2
by
Emerging Contributor

@ShariF  Sounds good. Thank you very much once again. I have not used Arcgis Online assistant, but I will try and see how it goes !!

0 Kudos
GD2
by
Emerging Contributor

@ShariF @DEWright_CA  were the map service on Portal or Server? Thanks both for sharing

0 Kudos
DEWright_CA
Frequent Contributor

The Mapservices were in Server; but referenced in WebMaps on Portal; and that worked just fine.

0 Kudos