<?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 Error when cloning Feature Layer (hosted) in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/error-when-cloning-feature-layer-hosted/m-p/1186675#M46644</link>
    <description>&lt;P&gt;I am trying to clone a &lt;SPAN&gt;Feature Layer (hosted) from one organization to another, but I get the following message saying "&amp;nbsp;There is already an object named 'Veilinjer_2d_2021_01_26". But the feature layer does not exist. During the cloning prosess the feature layer is created in the target, but with 0kb and no content. I can delete the feature layer, but I always get the same message. It happens with some feature layers, others is fine.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I get the same problem using ArcGIS Online Assistant, and drag and drop (copy/paste).&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;Failed to clone.
("Failed to create Feature Service Veilinjer_2d_2021_01_26: Unable to add feature service definition.\nThere is already an object named 'Veilinjer_2d_2021_01_26_000__2021_01_26_15' in the database.\n(Error Code: 400)", &amp;lt;Item title:"Veilinjer_2d_2021_01_26" type:Feature Layer Collection owner:ext_Norconsult_editor&amp;gt;)&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;My Jupyter Notebook:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;itemid_list = ["ca65f56b2bb94238b16ddcb0ea3c509c"]

x=1
for itemid in itemid_list:
    file_to_clone = source.content.get(itemid)
    print("******************")
    print("File to clone:")
    print("Title:" , file_to_clone.title)
    print("ID:" , file_to_clone.id)
    print("ULR:" , file_to_clone.url)

    # cloning starts
    print("******************")
    print("cloning")

    try:
        cloned_item = target.content.clone_items(items=[file_to_clone], folder="Transfer_2d")

    except Exception as e:
        print("Failed to clone.")
        print(str(e))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 27 Jun 2022 12:34:32 GMT</pubDate>
    <dc:creator>Geir-OveBrandal</dc:creator>
    <dc:date>2022-06-27T12:34:32Z</dc:date>
    <item>
      <title>Error when cloning Feature Layer (hosted)</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/error-when-cloning-feature-layer-hosted/m-p/1186675#M46644</link>
      <description>&lt;P&gt;I am trying to clone a &lt;SPAN&gt;Feature Layer (hosted) from one organization to another, but I get the following message saying "&amp;nbsp;There is already an object named 'Veilinjer_2d_2021_01_26". But the feature layer does not exist. During the cloning prosess the feature layer is created in the target, but with 0kb and no content. I can delete the feature layer, but I always get the same message. It happens with some feature layers, others is fine.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I get the same problem using ArcGIS Online Assistant, and drag and drop (copy/paste).&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;Failed to clone.
("Failed to create Feature Service Veilinjer_2d_2021_01_26: Unable to add feature service definition.\nThere is already an object named 'Veilinjer_2d_2021_01_26_000__2021_01_26_15' in the database.\n(Error Code: 400)", &amp;lt;Item title:"Veilinjer_2d_2021_01_26" type:Feature Layer Collection owner:ext_Norconsult_editor&amp;gt;)&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;My Jupyter Notebook:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;itemid_list = ["ca65f56b2bb94238b16ddcb0ea3c509c"]

x=1
for itemid in itemid_list:
    file_to_clone = source.content.get(itemid)
    print("******************")
    print("File to clone:")
    print("Title:" , file_to_clone.title)
    print("ID:" , file_to_clone.id)
    print("ULR:" , file_to_clone.url)

    # cloning starts
    print("******************")
    print("cloning")

    try:
        cloned_item = target.content.clone_items(items=[file_to_clone], folder="Transfer_2d")

    except Exception as e:
        print("Failed to clone.")
        print(str(e))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jun 2022 12:34:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/error-when-cloning-feature-layer-hosted/m-p/1186675#M46644</guid>
      <dc:creator>Geir-OveBrandal</dc:creator>
      <dc:date>2022-06-27T12:34:32Z</dc:date>
    </item>
    <item>
      <title>Re: Error when cloning Feature Layer (hosted)</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/error-when-cloning-feature-layer-hosted/m-p/1312896#M53618</link>
      <description>&lt;P&gt;I am running into similar issues. Could you figure out the issue.&lt;/P&gt;&lt;P&gt;TAI&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jul 2023 23:14:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/error-when-cloning-feature-layer-hosted/m-p/1312896#M53618</guid>
      <dc:creator>ReshmiMukherjee</dc:creator>
      <dc:date>2023-07-27T23:14:17Z</dc:date>
    </item>
  </channel>
</rss>

