<?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: Just Trying to Copy a Feature Service to a Local Geodatabase in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/just-trying-to-copy-a-feature-service-to-a-local/m-p/116760#M9179</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks,&amp;nbsp;&lt;A href="https://community.esri.com/migrated-users/19140" target="_blank"&gt;Luke Webb&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think I may have found a workaround. I changed my code to include and export and download of the feature service. This way I can essentially make a copy of a feature service and then plug it in locally from a workspace folder.&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;# import modules&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;from&lt;/SPAN&gt; arcgis&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;gis &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; GIS

&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; zipfile
&lt;SPAN class="keyword token"&gt;from&lt;/SPAN&gt; zipfile &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; ZipFile

&lt;SPAN class="comment token"&gt;#######################################################################################&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# Input working folder for shapefile to download too&lt;/SPAN&gt;
Folder_Input &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; input&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Provide Folder Path of Project"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# Provide item id of feature service&lt;/SPAN&gt;
Item_ID &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; input&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Provide item ID"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# Input name for shapefile export&lt;/SPAN&gt;
Shapefile_Input_Name &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; input&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Name Shapefile for Export"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;#######################################################################################&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# formatting inputs to fit syntax &lt;/SPAN&gt;
Folder_Path &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;'{}'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;Folder_Input&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

Shapefile_Name &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; Shapefile_Input_Name &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"_Shapfile"&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;#######################################################################################&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# searching and returning feature service&lt;/SPAN&gt;
gis &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; GIS&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"http://arcgis.com"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"XXXXXXXXX"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"XXXXXXXXXX"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

search_results &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; gis&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;content&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;search&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'{}'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;Item_ID&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

Trail_Data &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; search_results&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;


&lt;SPAN class="comment token"&gt;#######################################################################################&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# Exporting feature service to shapefile&lt;/SPAN&gt;
Trail_Data&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;export&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"{}"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;Shapefile_Name&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'Shapefile'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; parameters&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;None&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; wait&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token boolean"&gt;True&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;#search for new shapefile export&lt;/SPAN&gt;
item &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; gis&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;content&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;search&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;Shapefile_Name&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;#getting shapefile item&lt;/SPAN&gt;
shp &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; gis&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;content&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;get&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;item&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;itemid&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# download shapefile item &lt;/SPAN&gt;
shp_Download &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; shp&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;download&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;save_path&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;Folder_Input&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# unzip shapefile in working folder&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;with&lt;/SPAN&gt; ZipFile&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;shp_Download&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'r'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; zipObj&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
   zipObj&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;extractall&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;Folder_Input&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt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t;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 06:51:46 GMT</pubDate>
    <dc:creator>PhilipShutler1</dc:creator>
    <dc:date>2021-12-11T06:51:46Z</dc:date>
    <item>
      <title>Just Trying to Copy a Feature Service to a Local Geodatabase</title>
      <link>https://community.esri.com/t5/python-questions/just-trying-to-copy-a-feature-service-to-a-local/m-p/116758#M9177</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I will preface this post, in saying that I am new to script workflows in Python, and I believe that this process is probably very simple to accomplish but keep getting an error.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All I am trying to do is export/copy a feature service it to a local geodatabase where I can work on it locally.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have provided the code below. I keep getting an "Object: Error in executing tool" for the last line where I am trying to copy the feature.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;from&lt;/SPAN&gt; arcgis&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;gis &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; GIS
&lt;SPAN class="keyword token"&gt;from&lt;/SPAN&gt; arcgis&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;features&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;use_proximity &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; create_buffers

&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcpy

&lt;SPAN class="comment token"&gt;#########################################################################################&lt;/SPAN&gt;

GDB_Name &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; input&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Name Geodatabase"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

Folder_Input &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; input&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Provide Folder Path of Project"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

Item_ID &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; input&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Provide item ID"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;


&lt;SPAN class="comment token"&gt;#########################################################################################&lt;/SPAN&gt;

gis &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; GIS&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"http://arcgis.com"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"XXXXXXXX"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"XXXXXXXXXXX"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

search_results &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; gis&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;content&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;search&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'{}'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;Item_ID&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

Trail_Data &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; search_results&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;

WorkspaceGDB &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;CreateFileGDB_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;Folder_Input&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'{}.gdb'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;GDB_Name&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"GDB created"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;workspace &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;'{}'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;WorkspaceGDB&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;CopyFeatures&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;Trail_Data&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Area_Trail_Data"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 06:51:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/just-trying-to-copy-a-feature-service-to-a-local/m-p/116758#M9177</guid>
      <dc:creator>PhilipShutler1</dc:creator>
      <dc:date>2021-12-11T06:51:41Z</dc:date>
    </item>
    <item>
      <title>Re: Just Trying to Copy a Feature Service to a Local Geodatabase</title>
      <link>https://community.esri.com/t5/python-questions/just-trying-to-copy-a-feature-service-to-a-local/m-p/116759#M9178</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I must say it looks like you are doing very well with the pythons &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sadly, I dont think you can do what you are hoping, using the GIS API. This is largely for managing of "content" on the online ecosystem, and less involved with the actual raw data and map services behind the content.&amp;nbsp; &amp;nbsp;(For example, if you clone a map layer, both copies still point to the same published REST service on ArcGIS Server)&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;------------&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not certain as haven't tried this workflow, but I think you have a data type issue, rather than a python.&amp;nbsp; It is likely that this code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;search_results &lt;SPAN class="" style="color: #a67f59; background: rgba(255, 255, 255, 0.5); border: 0px; font-weight: inherit;"&gt;=&lt;/SPAN&gt; gis&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;.&lt;/SPAN&gt;content&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;.&lt;/SPAN&gt;search&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="" style="color: #669900; border: 0px; font-weight: inherit;"&gt;'{}'&lt;/SPAN&gt;&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;(&lt;/SPAN&gt;Item_ID&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;)&lt;/SPAN&gt;

Trail_Data &lt;SPAN class="" style="color: #a67f59; background: rgba(255, 255, 255, 0.5); border: 0px; font-weight: inherit;"&gt;=&lt;/SPAN&gt; search_results&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;[&lt;/SPAN&gt;&lt;SPAN class="" style="color: #990000; border: 0px; font-weight: inherit;"&gt;0&lt;/SPAN&gt;&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;]&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Probably returns a "ArcGIS Portal Layer",&amp;nbsp; &amp;nbsp;this has properties such as the name, title, sharing information etc.&amp;nbsp; However, this type of data cannot be used inside a "Geo-Processing Tool".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Possibly someone else can but in here, but I dont think that the features on a map service, are exposed in this manner.&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(As an example, If you tried dragging the services layers manually into an arcmap window, then dragging those layers into a geoprocessing tool, I think you will find even this is not permitted, possibly if the layer is published as a feature service instead of a map service they may work?)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think you would need to either:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Look into ArcGIS Offline editing and synchronisation.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;A class="link-titled" href="https://enterprise.arcgis.com/en/portal/latest/use/enable-offline-mapping.htm" title="https://enterprise.arcgis.com/en/portal/latest/use/enable-offline-mapping.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;Enable layers for offline mapping—Portal for ArcGIS | ArcGIS Enterprise&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;create a geoprocessing tool, on the server, that exports it to a shapefile/gdb format, similar to the clip and ship example:&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;A class="link-titled" href="https://enterprise.arcgis.com/en/server/10.6/publish-services/windows/gp-service-example-clip-and-ship.htm" title="https://enterprise.arcgis.com/en/server/10.6/publish-services/windows/gp-service-example-clip-and-ship.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;Geoprocessing service example: Clip And Ship—Documentation | ArcGIS Enterprise&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 06:51:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/just-trying-to-copy-a-feature-service-to-a-local/m-p/116759#M9178</guid>
      <dc:creator>LukeWebb</dc:creator>
      <dc:date>2021-12-11T06:51:43Z</dc:date>
    </item>
    <item>
      <title>Re: Just Trying to Copy a Feature Service to a Local Geodatabase</title>
      <link>https://community.esri.com/t5/python-questions/just-trying-to-copy-a-feature-service-to-a-local/m-p/116760#M9179</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks,&amp;nbsp;&lt;A href="https://community.esri.com/migrated-users/19140" target="_blank"&gt;Luke Webb&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think I may have found a workaround. I changed my code to include and export and download of the feature service. This way I can essentially make a copy of a feature service and then plug it in locally from a workspace folder.&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;# import modules&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;from&lt;/SPAN&gt; arcgis&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;gis &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; GIS

&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; zipfile
&lt;SPAN class="keyword token"&gt;from&lt;/SPAN&gt; zipfile &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; ZipFile

&lt;SPAN class="comment token"&gt;#######################################################################################&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# Input working folder for shapefile to download too&lt;/SPAN&gt;
Folder_Input &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; input&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Provide Folder Path of Project"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# Provide item id of feature service&lt;/SPAN&gt;
Item_ID &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; input&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Provide item ID"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# Input name for shapefile export&lt;/SPAN&gt;
Shapefile_Input_Name &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; input&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Name Shapefile for Export"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;#######################################################################################&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# formatting inputs to fit syntax &lt;/SPAN&gt;
Folder_Path &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;'{}'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;Folder_Input&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

Shapefile_Name &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; Shapefile_Input_Name &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"_Shapfile"&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;#######################################################################################&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# searching and returning feature service&lt;/SPAN&gt;
gis &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; GIS&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"http://arcgis.com"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"XXXXXXXXX"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"XXXXXXXXXX"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

search_results &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; gis&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;content&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;search&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'{}'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;Item_ID&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

Trail_Data &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; search_results&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;


&lt;SPAN class="comment token"&gt;#######################################################################################&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# Exporting feature service to shapefile&lt;/SPAN&gt;
Trail_Data&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;export&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"{}"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;Shapefile_Name&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'Shapefile'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; parameters&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;None&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; wait&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token boolean"&gt;True&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;#search for new shapefile export&lt;/SPAN&gt;
item &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; gis&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;content&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;search&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;Shapefile_Name&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;#getting shapefile item&lt;/SPAN&gt;
shp &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; gis&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;content&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;get&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;item&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;itemid&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# download shapefile item &lt;/SPAN&gt;
shp_Download &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; shp&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;download&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;save_path&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;Folder_Input&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# unzip shapefile in working folder&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;with&lt;/SPAN&gt; ZipFile&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;shp_Download&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'r'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; zipObj&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
   zipObj&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;extractall&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;Folder_Input&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&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N&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 06:51:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/just-trying-to-copy-a-feature-service-to-a-local/m-p/116760#M9179</guid>
      <dc:creator>PhilipShutler1</dc:creator>
      <dc:date>2021-12-11T06:51:46Z</dc:date>
    </item>
  </channel>
</rss>

