<?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: Non-Buggy Way to Duplicate Hosted Feature Service? in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/non-buggy-way-to-duplicate-hosted-feature-service/m-p/1355835#M9349</link>
    <description>&lt;P&gt;Yes, these are taking place all within the same portal.&lt;/P&gt;</description>
    <pubDate>Fri, 01 Dec 2023 18:27:48 GMT</pubDate>
    <dc:creator>SH_DH</dc:creator>
    <dc:date>2023-12-01T18:27:48Z</dc:date>
    <item>
      <title>Non-Buggy Way to Duplicate Hosted Feature Service?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/non-buggy-way-to-duplicate-hosted-feature-service/m-p/1355735#M9347</link>
      <description>&lt;P&gt;I have a script I use to create groups, create new layers based off existing template hosted feature layers, set up a webmap, and share with my organization.&amp;nbsp; I have been successfully using copy_feature_layer_collection, however I want to update my template hosted feature layer to have related tables. copy_feature_layer_collection technically should support that, but there's been a handful of threads showing there are bugs preventing it from working.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;cloned_flyr = hosted_flyr.copy_feature_layer_collection('{} Observations'.format(project_number), layers = [0, 1, 2]) &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've played around with clone_items, which should also work for this application, however it does nothing. I have entered it directly into the Python window in Pro and it and runs for a few seconds, then returns an empty list without an error. An empty hosted feature service is created in ArcGIS Online but absent of any layers.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;cloned_flyr = gis.content.clone_items(items = [hosted_flyr], folder = '{}'.format(project_title) , copy_data = True, copy_global_ids = False, preserve_item_id = False)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anything I'm missing here, or any other commands I should try? copy() seems to duplicate the item but still points to the original hosted feature layer URL, so that won't fit the bill.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Dec 2023 16:01:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/non-buggy-way-to-duplicate-hosted-feature-service/m-p/1355735#M9347</guid>
      <dc:creator>SH_DH</dc:creator>
      <dc:date>2023-12-01T16:01:26Z</dc:date>
    </item>
    <item>
      <title>Re: Non-Buggy Way to Duplicate Hosted Feature Service?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/non-buggy-way-to-duplicate-hosted-feature-service/m-p/1355794#M9348</link>
      <description>&lt;P&gt;For the clone_items method are you doing this between two portals? The &lt;A href="https://developers.arcgis.com/python/guide/cloning-content/" target="_self"&gt;documentation&lt;/A&gt; discusses that it is a workflow for use from one portal to another.&lt;/P&gt;&lt;P&gt;Many thanks,&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;</description>
      <pubDate>Fri, 01 Dec 2023 17:17:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/non-buggy-way-to-duplicate-hosted-feature-service/m-p/1355794#M9348</guid>
      <dc:creator>David_McRitchie</dc:creator>
      <dc:date>2023-12-01T17:17:47Z</dc:date>
    </item>
    <item>
      <title>Re: Non-Buggy Way to Duplicate Hosted Feature Service?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/non-buggy-way-to-duplicate-hosted-feature-service/m-p/1355835#M9349</link>
      <description>&lt;P&gt;Yes, these are taking place all within the same portal.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Dec 2023 18:27:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/non-buggy-way-to-duplicate-hosted-feature-service/m-p/1355835#M9349</guid>
      <dc:creator>SH_DH</dc:creator>
      <dc:date>2023-12-01T18:27:48Z</dc:date>
    </item>
    <item>
      <title>Re: Non-Buggy Way to Duplicate Hosted Feature Service?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/non-buggy-way-to-duplicate-hosted-feature-service/m-p/1355858#M9350</link>
      <description>&lt;P&gt;As far as I can tell, everything seems to be in order. It's not really advertised, but you can do same-portal clones (I used to do this quite a bit for similar reasons). Some other things you can try are exporting the data or creating a replica. From there, you can prepare the data as you wish locally and then publish as usual. If it fails to do either one of those, maybe there will be an error that provides more insight.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Dec 2023 18:54:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/non-buggy-way-to-duplicate-hosted-feature-service/m-p/1355858#M9350</guid>
      <dc:creator>EarlMedina</dc:creator>
      <dc:date>2023-12-01T18:54:12Z</dc:date>
    </item>
    <item>
      <title>Re: Non-Buggy Way to Duplicate Hosted Feature Service?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/non-buggy-way-to-duplicate-hosted-feature-service/m-p/1408461#M9870</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/647438"&gt;@SH_DH&lt;/a&gt;&lt;/P&gt;&lt;P&gt;I wonder whether the layers within your new feature service may be empty because clone_items() detects that they have already been cloned previously within your portal?&lt;/P&gt;&lt;P&gt;This section of the documentation describes this -&amp;nbsp;&lt;A href="https://developers.arcgis.com/python/guide/cloning-content/#the-cloning-process" target="_blank"&gt;https://developers.arcgis.com/python/guide/cloning-content/#the-cloning-process&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PeterHodkinson_0-1712836410171.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/100662i372EDE8F40C31959/image-size/medium?v=v2&amp;amp;px=400" role="button" title="PeterHodkinson_0-1712836410171.png" alt="PeterHodkinson_0-1712836410171.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;To workaround this you could set the parameter &lt;EM&gt;search_existing_items=False&lt;/EM&gt; within&amp;nbsp;clone_items()&lt;/P&gt;</description>
      <pubDate>Thu, 11 Apr 2024 11:55:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/non-buggy-way-to-duplicate-hosted-feature-service/m-p/1408461#M9870</guid>
      <dc:creator>PeterHodkinson</dc:creator>
      <dc:date>2024-04-11T11:55:54Z</dc:date>
    </item>
  </channel>
</rss>

