<?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: Upgraded to ArcGIS Pro 3.3.0 from 3.2.2 - content.add() no longer has an 'overwrite' item property in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/upgraded-to-arcgis-pro-3-3-0-from-3-2-2-content/m-p/1524642#M10451</link>
    <description>&lt;P&gt;Just encountered this as well, same workflow to update Vector Tiles, probably using the same code snippet provided by Esri.&amp;nbsp; Fortunately I have an email delivered at the end of the script reporting on the success or failure of the scheduled task to update the Vector Tiles, so was able to capture this error.&lt;/P&gt;&lt;P&gt;I went in and modified the script to run an update on the layer tile package instead of an add with overwrite.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;    vtpk_properties = {
        'title': 'LA County Basemap Source Vector Tiles - STAGED',
        'description': 'Updated/staged version of LA County Base Map Vector Tiles',
        'tags': 'Vector Tile'}

    vtpk_item = gis.content.get(vtpkID)
    vtpk_item.update(item_properties=vtpk_properties, data=vtpk)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then do the publish and replace&lt;/P&gt;&lt;LI-CODE lang="python"&gt;    vtpk_service_item = vtpk_item.publish()
    print("VECTOR TILE PACKAGE:\nTitle: " + str(vtpk_item.title) + " ID: " + str(vtpk_item.id))
    print("VECTOR TILE SERVICE:\nTitle: " + str(vtpk_service_item.title) + " ID: " + str(vtpk_service_item.id))

    gis.content.replace_service(prodTileCacheID, vtpk_service_item.id)
  &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 20 Aug 2024 19:10:33 GMT</pubDate>
    <dc:creator>TomWeisenberger</dc:creator>
    <dc:date>2024-08-20T19:10:33Z</dc:date>
    <item>
      <title>Upgraded to ArcGIS Pro 3.3.0 from 3.2.2 - content.add() no longer has an 'overwrite' item property</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/upgraded-to-arcgis-pro-3-3-0-from-3-2-2-content/m-p/1494984#M10209</link>
      <description>&lt;P&gt;Hey everyone,&lt;BR /&gt;&lt;BR /&gt;I'm currently running the minor-release-gauntlet with my Python scripts. I've upgraded to Pro 3.3.0 from Pro 3.2.2 in my testing environment and am executing my Python scripts to ensure I haven't missed anything with deprecations since Python jumped from 3.9 to 3.11.&lt;BR /&gt;&lt;BR /&gt;I've come across one scenario where it does appear that a feature has been deprecated, and I'm hoping to get some advice and/or clarification on what I should use instead.&lt;BR /&gt;&lt;BR /&gt;In this scenario, my script has been uploading a Vector Tile Package to our ArcGIS Online account for a couple of years without issue. I do this by initiating an AGOL session in Python, then proceeding with agol_session.content.add() to upload the VTPK. Code snippet here:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# Attempts to add the VTPK file to AGOL, with parameters set.
upload_result = agol_session.content.add(
                item_properties={"title": vtpk_name,
                                 "description": "Description Text",
                                 "snippet": "Snippet Text",
                                 "tags": "OurAgencyName",
                                 "overwrite": True},
                data=vtpk_path, owner="OwnerName")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The upload is successful in Pro 3.3.0, but I now receive this warning message:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="anonymous_geographer_0-1718808850313.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/107437i2B292409BB78CB38/image-size/medium?v=v2&amp;amp;px=400" role="button" title="anonymous_geographer_0-1718808850313.png" alt="anonymous_geographer_0-1718808850313.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Attempting to re-run the script (and overwrite the previously uploaded VTPK) results in a new error:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="anonymous_geographer_0-1718811952552.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/107446iE688921D6FF116A5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="anonymous_geographer_0-1718811952552.png" alt="anonymous_geographer_0-1718811952552.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;The error makes sense, since 'overwrite' parameter has been deprecated. However, I have been unable to find any details about this deprecation. Confusingly, the current &lt;A href="https://developers.arcgis.com/python/api-reference/arcgis.gis.toc.html#arcgis.gis.ContentManager.add" target="_blank" rel="noopener"&gt;item_properties&lt;/A&gt; documentation for content.add()&amp;nbsp; still show 'overwrite' as an option:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="anonymous_geographer_0-1718823764626.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/107455i50B52260F0E7D8D9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="anonymous_geographer_0-1718823764626.png" alt="anonymous_geographer_0-1718823764626.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;The overwrite parameter would overwrite the file uploaded to AGOL if the name/file already existed. We liked that feature (sometimes we need to re-run the content.add() workflow more than once a day if a quick replacement is needed for the same VTPK). The naming convention of the VTPK upload has been YYYYMMDD_AgencyName_BasemapAffiliatedName. I could start including HHMMSS to help keep the duplication from occurring, but I'd rather just use a parameter that accomplishes an overwrite if a new one was created.&lt;/P&gt;&lt;P&gt;Any thoughts or recommendations? Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jun 2024 20:12:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/upgraded-to-arcgis-pro-3-3-0-from-3-2-2-content/m-p/1494984#M10209</guid>
      <dc:creator>David_Lindsey</dc:creator>
      <dc:date>2024-06-19T20:12:49Z</dc:date>
    </item>
    <item>
      <title>Re: Upgraded to ArcGIS Pro 3.3.0 from 3.2.2 - content.add() no longer has an 'overwrite' item property</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/upgraded-to-arcgis-pro-3-3-0-from-3-2-2-content/m-p/1524642#M10451</link>
      <description>&lt;P&gt;Just encountered this as well, same workflow to update Vector Tiles, probably using the same code snippet provided by Esri.&amp;nbsp; Fortunately I have an email delivered at the end of the script reporting on the success or failure of the scheduled task to update the Vector Tiles, so was able to capture this error.&lt;/P&gt;&lt;P&gt;I went in and modified the script to run an update on the layer tile package instead of an add with overwrite.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;    vtpk_properties = {
        'title': 'LA County Basemap Source Vector Tiles - STAGED',
        'description': 'Updated/staged version of LA County Base Map Vector Tiles',
        'tags': 'Vector Tile'}

    vtpk_item = gis.content.get(vtpkID)
    vtpk_item.update(item_properties=vtpk_properties, data=vtpk)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then do the publish and replace&lt;/P&gt;&lt;LI-CODE lang="python"&gt;    vtpk_service_item = vtpk_item.publish()
    print("VECTOR TILE PACKAGE:\nTitle: " + str(vtpk_item.title) + " ID: " + str(vtpk_item.id))
    print("VECTOR TILE SERVICE:\nTitle: " + str(vtpk_service_item.title) + " ID: " + str(vtpk_service_item.id))

    gis.content.replace_service(prodTileCacheID, vtpk_service_item.id)
  &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Aug 2024 19:10:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/upgraded-to-arcgis-pro-3-3-0-from-3-2-2-content/m-p/1524642#M10451</guid>
      <dc:creator>TomWeisenberger</dc:creator>
      <dc:date>2024-08-20T19:10:33Z</dc:date>
    </item>
  </channel>
</rss>

