<?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: Using ArcPY to Overwrite AGOL Feature Service, ArcGIS Pro Symbology not being Applied in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/using-arcpy-to-overwrite-agol-feature-service/m-p/1600955#M64208</link>
    <description>&lt;P&gt;Josh:&lt;/P&gt;&lt;P&gt;What would&amp;nbsp;&lt;SPAN&gt;truncate/append method script look like?&amp;nbsp; Do you have a sample?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 31 Mar 2025 17:21:12 GMT</pubDate>
    <dc:creator>MikeVolz</dc:creator>
    <dc:date>2025-03-31T17:21:12Z</dc:date>
    <item>
      <title>Using ArcPY to Overwrite AGOL Feature Service, ArcGIS Pro Symbology not being Applied</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/using-arcpy-to-overwrite-agol-feature-service/m-p/1479130#M59372</link>
      <description>&lt;P&gt;I have a python script that overwrites a feature service on a nightly basis.&amp;nbsp; Up until this weekend the script was running great.&amp;nbsp; Now when my script runs, it does finish without any errors or warnings but the symbology in my ArcGIS Pro project is not being applied.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;The symbology that I use in ArcGIS Pro...&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DJB_0-1716824571647.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/105448i80E9F06495A87B2F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="DJB_0-1716824571647.png" alt="DJB_0-1716824571647.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;My feature service symbology, in AGOL, before my python script is run...&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DJB_1-1716824642083.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/105449iA55927DEDA9AA4FA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="DJB_1-1716824642083.png" alt="DJB_1-1716824642083.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;My feature service symbology after I run my script...&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DJB_2-1716825108415.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/105450i8B28EAC5073F85A3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="DJB_2-1716825108415.png" alt="DJB_2-1716825108415.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;And when I manually overwrite the service in ArcGIS Pro, the symbology is then applied properly again.&lt;/P&gt;&lt;P&gt;I'm not sure what has changed that my python script no longer applies the appropriate symbology.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;import arcpy, os, sys, shutil
from arcgis.gis import GIS

prjPath = r"C:\GIS_Workspace\Projects\Berry_Disease_Mapping\Berry_Disease_Modelling\Berry_Risk_Prediction.aprx"

print("Berry_Disease_Risk_Ratings Service Creation")
sd_fs_name = "Berry_Disease_Risk_Modelling"
item_id = "ae23b9349c9942a0b34cb919be434919"
portal = "http://www.arcgis.com" 
user = "LOGIN"
password = "XXXXXXX"

# Local paths to create temporary content
sddraft = r"C:\GIS_Workspace\Projects\Berry_Disease_Mapping\Berry_Disease_Risk_Modelling.sddraft"
sd = r"C:\GIS_Workspace\Projects\Berry_Disease_Mapping\Berry_Disease_Risk_Modelling.sd" 

# Create a new SDDraft and stage to SD
print("Creating SD file")
arcpy.env.overwriteOutput = True
prj = arcpy.mp.ArcGISProject(prjPath)
mp = prj.listMaps('For_Mapping_Service')[0]
arcpy.mp.CreateWebLayerSDDraft(mp, sddraft, sd_fs_name, "MY_HOSTED_SERVICES", "FEATURE_ACCESS","", True, True)
arcpy.StageService_server(sddraft, sd)

print("Connecting to {}".format(portal))
gis = GIS(portal, user, password)

# Find the SD, update it, publish /w overwrite and set sharing and metadata
print("Search for original SD on portal…")
sdItem = gis.content.get(item_id)
print("Found SD: {}, ID: {} n Uploading and overwriting…".format(sdItem.title, sdItem.id))
sdItem.update(data=sd)
print("Overwriting existing feature service…")
fs = sdItem.publish(overwrite=True)

print("Finished updating: {} – ID: {}".format(fs.title, fs.id))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I should note that I recently upgraded my Pro to 3.3 earlier and ever since then my script has not been behaving the way that it use to.&amp;nbsp; Not sure if one has anything to do with the other.&lt;/P&gt;&lt;P&gt;I also have another thread that outlines how item.share has been deprecated as well.&amp;nbsp; Also started after my upgrade.&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/arcgis-online-documents/overwrite-arcgis-online-feature-service-using/ta-p/1371248" target="_blank" rel="noopener"&gt;Overwrite ArcGIS Online Feature Service using ArcG... - Esri Community&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 27 May 2024 20:11:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/using-arcpy-to-overwrite-agol-feature-service/m-p/1479130#M59372</guid>
      <dc:creator>DJB</dc:creator>
      <dc:date>2024-05-27T20:11:45Z</dc:date>
    </item>
    <item>
      <title>Re: Using ArcPY to Overwrite AGOL Feature Service, ArcGIS Pro Symbology not being Applied</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/using-arcpy-to-overwrite-agol-feature-service/m-p/1479476#M59385</link>
      <description>&lt;P&gt;I don't have any answer for why arcpy is dropping your symbology settings, but I'd encourage you to move your process to a truncate/append method rather than simply overwriting. This would refresh the data, but would not touch any layer configuration or symbology settings.&lt;/P&gt;</description>
      <pubDate>Tue, 28 May 2024 13:03:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/using-arcpy-to-overwrite-agol-feature-service/m-p/1479476#M59385</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2024-05-28T13:03:32Z</dc:date>
    </item>
    <item>
      <title>Re: Using ArcPY to Overwrite AGOL Feature Service, ArcGIS Pro Symbology not being Applied</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/using-arcpy-to-overwrite-agol-feature-service/m-p/1600955#M64208</link>
      <description>&lt;P&gt;Josh:&lt;/P&gt;&lt;P&gt;What would&amp;nbsp;&lt;SPAN&gt;truncate/append method script look like?&amp;nbsp; Do you have a sample?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 31 Mar 2025 17:21:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/using-arcpy-to-overwrite-agol-feature-service/m-p/1600955#M64208</guid>
      <dc:creator>MikeVolz</dc:creator>
      <dc:date>2025-03-31T17:21:12Z</dc:date>
    </item>
    <item>
      <title>Re: Using ArcPY to Overwrite AGOL Feature Service, ArcGIS Pro Symbology not being Applied</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/using-arcpy-to-overwrite-agol-feature-service/m-p/1660774#M66782</link>
      <description>&lt;P&gt;This sample script has been previously posted:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/arcgis-online-documents/overwrite-arcgis-online-feature-service-using/ta-p/1371248" target="_blank"&gt;https://community.esri.com/t5/arcgis-online-documents/overwrite-arcgis-online-feature-service-using/ta-p/1371248&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Oct 2025 23:06:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/using-arcpy-to-overwrite-agol-feature-service/m-p/1660774#M66782</guid>
      <dc:creator>JordanCarmona</dc:creator>
      <dc:date>2025-10-24T23:06:37Z</dc:date>
    </item>
  </channel>
</rss>

