<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Updating GIS content on Portal in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/updating-gis-content-on-portal/m-p/800637#M2039</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Fantastic, I will keep that one in mind.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pity that the client didn't want to use AGO Assistant though.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have fun &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 20 Feb 2020 21:42:59 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2020-02-20T21:42:59Z</dc:date>
    <item>
      <title>Updating GIS content on Portal</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/updating-gis-content-on-portal/m-p/800634#M2036</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Greetings,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The fragment below works, cloning GIS content from Portal A to B.&lt;/P&gt;&lt;P&gt;gis2.content.clone_items(data, copy_data=True, search_existing_items=True)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, the REST URL is copied across ie it has the wrong REST in Portal B.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I read the ESRI article:&amp;nbsp;&lt;A href="https://developers.arcgis.com/python/sample-notebooks/using-and-updating-gis-content/"&gt;https://developers.arcgis.com/python/sample-notebooks/using-and-updating-gis-content/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The web map has a number of "values" eg: id, title, url, etc. So I tried to use the method in updating GIS content:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;gis2 = GIS(target_portal, username=admin, password=passw, verify_cert=False)&lt;BR /&gt;print("LOGGED IN TARGET")&lt;/P&gt;&lt;P&gt;####MAP ID&lt;BR /&gt;#map id&lt;BR /&gt;search_result = gis2.content.get('4aa844d480704a7392a1bc0b992dee2d')&lt;BR /&gt;print("MAP")&lt;BR /&gt;display(search_result)&lt;/P&gt;&lt;P&gt;##search_result.layers&lt;/P&gt;&lt;P&gt;#MAP SEARCH&lt;BR /&gt;search_result_json = gis2.content.search('title:LQSP', item_type="*")&lt;BR /&gt;#display(search_result_json)&lt;/P&gt;&lt;P&gt;#CREATE MAP OBJECT&lt;BR /&gt;wm_item = search_result_json[0]&lt;/P&gt;&lt;P&gt;from arcgis.mapping import WebMap&lt;BR /&gt;web_map_obj = WebMap(wm_item)&lt;BR /&gt;## display(web_map_obj) ### prints map&lt;/P&gt;&lt;P&gt;#DISPLAY JSON&lt;BR /&gt;print("WEB MAP OBJ")&lt;BR /&gt;web_map_obj.layers&lt;/P&gt;&lt;P&gt;print("DISPLAYS JSON: ")&lt;BR /&gt;#display(web_map_obj.layers)&lt;/P&gt;&lt;P&gt;for lyr in web_map_obj.layers:&lt;BR /&gt; print(lyr.title + " " + lyr.url)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;The section to update the url value is below, this fails??&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;web_map_obj.update(url='&amp;lt;server&amp;gt;arcgis/rest/services/&amp;lt;map&amp;gt;/MapServer') &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to update the url from:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;lt;DEV.gov.uk&amp;gt;arcgis/rest/services/&amp;lt;map&amp;gt;/MapServer&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;TO:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;lt;TEST.gov.uk&amp;gt;arcgis/rest/services/&amp;lt;map&amp;gt;/MapServer&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I welcome any suggestions.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Clive&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Feb 2020 22:30:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/updating-gis-content-on-portal/m-p/800634#M2036</guid>
      <dc:creator>CliveSwan</dc:creator>
      <dc:date>2020-02-13T22:30:45Z</dc:date>
    </item>
    <item>
      <title>Re: Updating GIS content on Portal</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/updating-gis-content-on-portal/m-p/800635#M2037</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Clive,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://ago-assistant.esri.com/" title="https://ago-assistant.esri.com/"&gt;ArcGIS Online Assistant&lt;/A&gt;&amp;nbsp;is you friend here.&lt;/P&gt;&lt;P&gt;You can edit the resources JSON file directly and it even has a "find and replace" function.&lt;/P&gt;&lt;P&gt;It can also transfer items from one portal to another.&lt;/P&gt;&lt;P&gt;You can even host it yourself if you like &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;BR /&gt;&lt;A class="link-titled" href="https://github.com/Esri/ago-assistant" title="https://github.com/Esri/ago-assistant"&gt;GitHub - Esri/ago-assistant: A swiss army knife for your ArcGIS Online and Portal for ArcGIS accounts&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the unsung utility that can help you more than you think...&lt;/P&gt;&lt;P&gt;Just be careful, because you are editing the items JSON, you can also break it pretty quickly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have fun&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Michael&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Feb 2020 02:46:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/updating-gis-content-on-portal/m-p/800635#M2037</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2020-02-14T02:46:50Z</dc:date>
    </item>
    <item>
      <title>Re: Updating GIS content on Portal</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/updating-gis-content-on-portal/m-p/800636#M2038</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Michael,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The client doesn't want to use Jypter Notebooks not ArcGIS Online assistant.&lt;A href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fago-assistant.esri.com%2F" rel="nofollow" style="background-attachment: scroll; background-clip: border-box; background-color: transparent; background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: repeat; background-size: auto; border-image-outset: 0; border-image-repeat: stretch; border-image-slice: 100%; border-image-source: none; border-image-width: 1; color: rgba(2, 8, 3, 1); display: inline; fill: #287433; font-family: arial,helvetica,&amp;amp;quot; helvetica neue&amp;amp;quot;,verdana,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; height: auto; letter-spacing: normal; orphans: 2; outline-color: invert; outline-style: none; outline-width: 0px; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; transition-delay: 0s; transition-duration: 0.1s; transition-property: color; transition-timing-function: cubic-bezier(0, 0, 1, 1); vertical-align: baseline; -webkit-text-stroke-width: 0px; white-space: normal; width: auto; word-spacing: 0px; padding: 0px calc(0.35ex + 12px) 0px 0px; margin: 0px; border: 0px none #287433;" target="_blank"&gt;/external-link.jspa?url=https%3A%2F%2Fago-assistant.esri.com%2F&lt;/A&gt;&lt;A href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fago-assistant.esri.com%2F" rel="nofollow" style="background-attachment: scroll; background-clip: border-box; background-color: transparent; background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: repeat; background-size: auto; border-image-outset: 0; border-image-repeat: stretch; border-image-slice: 100%; border-image-source: none; border-image-width: 1; color: rgba(2, 8, 3, 1); display: inline; fill: #287433; font-family: arial,helvetica,&amp;amp;quot; helvetica neue&amp;amp;quot;,verdana,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; height: auto; letter-spacing: normal; orphans: 2; outline-color: invert; outline-style: none; outline-width: 0px; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; transition-delay: 0s; transition-duration: 0.1s; transition-property: color; transition-timing-function: cubic-bezier(0, 0, 1, 1); vertical-align: baseline; -webkit-text-stroke-width: 0px; white-space: normal; width: auto; word-spacing: 0px; padding: 0px calc(0.35ex + 12px) 0px 0px; margin: 0px; border: 0px none #287433;" target="_blank"&gt;/external-link.jspa?url=https%3A%2F%2Fago-assistant.esri.com%2F&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I eventually!!! found a Python script to update the Webmap URL:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://enterprise.arcgis.com/en/portal/latest/administer/windows/example-update-the-url-of-a-service-in-a-web-map.htm"&gt;https://enterprise.arcgis.com/en/portal/latest/administer/windows/example-update-the-url-of-a-service-in-a-web-map.htm&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Feb 2020 09:36:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/updating-gis-content-on-portal/m-p/800636#M2038</guid>
      <dc:creator>CliveSwan</dc:creator>
      <dc:date>2020-02-14T09:36:52Z</dc:date>
    </item>
    <item>
      <title>Re: Updating GIS content on Portal</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/updating-gis-content-on-portal/m-p/800637#M2039</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Fantastic, I will keep that one in mind.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pity that the client didn't want to use AGO Assistant though.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have fun &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Feb 2020 21:42:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/updating-gis-content-on-portal/m-p/800637#M2039</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2020-02-20T21:42:59Z</dc:date>
    </item>
  </channel>
</rss>

