<?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 Publish the map service to hosted server. in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/publish-the-map-service-to-hosted-server/m-p/170839#M13133</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;I am trying to overwrite the existing service but I am getting the error below. The python version I am using is 3.5 and ArcGIS&amp;nbsp;PRO version is 2.0. I am also attaching the Python script I am using.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Traceback (most recent call last):&lt;BR /&gt;File "\\i-file\Sprint\Network\02\NGN\RingConstruction\AlteryxScripts\publishtest.py", line 56, in &amp;lt;module&amp;gt;&lt;BR /&gt;arcpy.UploadServiceDefinition_server(r"\\i-file\Sprint\Network\02\NGN\RingConstruction\DarkFiberProgressReport\NNI\NNItest.sd", "My Hosted Services", "NNItest", "EXISTING","NNI", "STARTED")&lt;BR /&gt;File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\server.py", line 876, in UploadServiceDefinition&lt;BR /&gt;raise e&lt;BR /&gt;File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\server.py", line 873, in UploadServiceDefinition&lt;BR /&gt;retval = convertArcObjectToPythonObject(gp.UploadServiceDefinition_server(*gp_fixargs((in_sd_file, in_server, in_service_name, in_cluster, in_folder_type, in_folder, in_startupType, in_override, in_my_contents, in_public, in_organization, in_groups), True)))&lt;BR /&gt;File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\geoprocessing\_base.py", line 506, in &amp;lt;lambda&amp;gt;&lt;BR /&gt;return lambda *args: val(*gp_fixargs(args, True))&lt;BR /&gt;arcgisscripting.ExecuteError: ERROR 001398: Service name 'NNItest' already exists.&lt;BR /&gt;Failed to execute (UploadServiceDefinition).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help is appreciated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 18 Sep 2018 15:39:09 GMT</pubDate>
    <dc:creator>ManjariGoyal</dc:creator>
    <dc:date>2018-09-18T15:39:09Z</dc:date>
    <item>
      <title>Publish the map service to hosted server.</title>
      <link>https://community.esri.com/t5/python-questions/publish-the-map-service-to-hosted-server/m-p/170839#M13133</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;I am trying to overwrite the existing service but I am getting the error below. The python version I am using is 3.5 and ArcGIS&amp;nbsp;PRO version is 2.0. I am also attaching the Python script I am using.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Traceback (most recent call last):&lt;BR /&gt;File "\\i-file\Sprint\Network\02\NGN\RingConstruction\AlteryxScripts\publishtest.py", line 56, in &amp;lt;module&amp;gt;&lt;BR /&gt;arcpy.UploadServiceDefinition_server(r"\\i-file\Sprint\Network\02\NGN\RingConstruction\DarkFiberProgressReport\NNI\NNItest.sd", "My Hosted Services", "NNItest", "EXISTING","NNI", "STARTED")&lt;BR /&gt;File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\server.py", line 876, in UploadServiceDefinition&lt;BR /&gt;raise e&lt;BR /&gt;File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\server.py", line 873, in UploadServiceDefinition&lt;BR /&gt;retval = convertArcObjectToPythonObject(gp.UploadServiceDefinition_server(*gp_fixargs((in_sd_file, in_server, in_service_name, in_cluster, in_folder_type, in_folder, in_startupType, in_override, in_my_contents, in_public, in_organization, in_groups), True)))&lt;BR /&gt;File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\geoprocessing\_base.py", line 506, in &amp;lt;lambda&amp;gt;&lt;BR /&gt;return lambda *args: val(*gp_fixargs(args, True))&lt;BR /&gt;arcgisscripting.ExecuteError: ERROR 001398: Service name 'NNItest' already exists.&lt;BR /&gt;Failed to execute (UploadServiceDefinition).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help is appreciated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Sep 2018 15:39:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/publish-the-map-service-to-hosted-server/m-p/170839#M13133</guid>
      <dc:creator>ManjariGoyal</dc:creator>
      <dc:date>2018-09-18T15:39:09Z</dc:date>
    </item>
    <item>
      <title>Re: Publish the map service to hosted server.</title>
      <link>https://community.esri.com/t5/python-questions/publish-the-map-service-to-hosted-server/m-p/170840#M13134</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Manjari,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It looks like your script is attempting to publish a new service rather than overwrite a service.&amp;nbsp; You should take a look at code sample example 3 in the following documentation, which provides syntax needed to overwrite a service.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://desktop.arcgis.com/en/arcmap/latest/tools/server-toolbox/stage-service.htm#C_GUID-E4EE691D-C5C2-4F1C-BBC9-D600F4F8689E" title="http://desktop.arcgis.com/en/arcmap/latest/tools/server-toolbox/stage-service.htm#C_GUID-E4EE691D-C5C2-4F1C-BBC9-D600F4F8689E"&gt;Stage Service—Help | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have you also thought about using the ArcGIS API for Python? Using the arcgis python module installed with Pro, you can utilize a much simpler workflow and script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://developers.arcgis.com/python/sample-notebooks/overwriting-feature-layers/" title="https://developers.arcgis.com/python/sample-notebooks/overwriting-feature-layers/"&gt;overwriting_feature_layers | ArcGIS for Developers&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Marisa&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Sep 2018 14:11:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/publish-the-map-service-to-hosted-server/m-p/170840#M13134</guid>
      <dc:creator>MarisaClaggett</dc:creator>
      <dc:date>2018-09-20T14:11:23Z</dc:date>
    </item>
  </channel>
</rss>

