<?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 clone_items() doesn't work with ArcGIS Enterprise Portal 11.1? in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/clone-items-doesn-t-work-with-arcgis-enterprise/m-p/1487973#M10146</link>
    <description>&lt;P&gt;I just upgraded to ArcGIS Portal 11.1, and now clone_items() doesn't work. Here is an example:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;item_id = 'f977c5ea26de465bb21c796dc7e5d95a'
item = source_gis.content.get(item_id)
cloned_items = target_gis.content.clone_items(items=[item], preserve_item_id=True)&lt;/LI-CODE&gt;&lt;P&gt;And here is the error traceback:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;---------------------------------------------------------------------------&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;AttributeError Traceback (most recent call last)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;~\AppData\Local\Temp\ipykernel_17668\1636443366.py in &amp;lt;cell line: 1&amp;gt;()&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;----&amp;gt; 1 cloned_items = target_gis.content.clone_items(items=[item], preserve_item_id=True)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;2 cloned_items&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\gis\__init__.py in clone_items(self, items, folder, item_extent, use_org_basemap, copy_data, copy_global_ids, search_existing_items, item_mapping, group_mapping, owner, preserve_item_id)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;7887 preserve_item_id = False&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;7888 &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;-&amp;gt; 7889 deep_cloner = clone._DeepCloner(&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;7890 self._gis,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;7891 items,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\_impl\common\_clone.py in __init__(self, target, items, folder, item_extent, service_extent, use_org_basemap, copy_data, copy_global_ids, search_existing_items, item_mapping, group_mapping, owner, preserve_item_id)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;106 self._temp_dir = tempfile.TemporaryDirectory()&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;107 # parse the config and get values&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;--&amp;gt; 108 self._create_graph()&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;109 self._cloned_items = []&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;110&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\_impl\common\_clone.py in _create_graph(self)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;118 user = self.target.users.me&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;119 # Get the definitions associated with the item&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;--&amp;gt; 120 self._get_item_definitions(item)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;121 &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;122 # Test if the user has the correct privileges to create the items requested&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\_impl\common\_clone.py in _get_item_definitions(self, item)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;987 # All other types we no longer need to recursively look for related items&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;988 else:&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;--&amp;gt; 989 item_definition = self._get_item_definition(item)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;990 self._graph[item.id] = item_definition&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;991&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\_impl\common\_clone.py in _get_item_definition(self, item)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;1611 )&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;1612 &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;-&amp;gt; 1613 return _WebExperience(&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;1614 self.target,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;1615 self._clone_mapping,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\_impl\common\_itemdef\_expbuilder.py in __init__(self, target, clone_mapping, info, data, sharing, thumbnail, portal_item, folder, item_extent, search_existing, owner, **kwargs)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;25 **kwargs,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;26 &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;---&amp;gt; 27 super().__init__(target, clone_mapping, search_existing)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;28 self.info = info&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;29 self._preserve_item_id = kwargs.pop("preserve_item_id", False)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\_impl\common\_clone.py in __init__(self, target, clone_mapping, info, data, sharing, thumbnail, portal_item, folder, item_extent, search_existing, owner, **kwargs)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;1987 self.item_extent = item_extent&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;1988 self.created_items = []&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;-&amp;gt; 1989 self.metadata_xml = portal_item.metadata&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;1990 &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;1991 @property&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;AttributeError: 'NoneType' object has no attribute 'metadata'&lt;/FONT&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;Any ideas?&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 10 Jun 2024 00:18:39 GMT</pubDate>
    <dc:creator>BBowers_napacounty</dc:creator>
    <dc:date>2024-06-10T00:18:39Z</dc:date>
    <item>
      <title>clone_items() doesn't work with ArcGIS Enterprise Portal 11.1?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/clone-items-doesn-t-work-with-arcgis-enterprise/m-p/1487973#M10146</link>
      <description>&lt;P&gt;I just upgraded to ArcGIS Portal 11.1, and now clone_items() doesn't work. Here is an example:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;item_id = 'f977c5ea26de465bb21c796dc7e5d95a'
item = source_gis.content.get(item_id)
cloned_items = target_gis.content.clone_items(items=[item], preserve_item_id=True)&lt;/LI-CODE&gt;&lt;P&gt;And here is the error traceback:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;---------------------------------------------------------------------------&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;AttributeError Traceback (most recent call last)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;~\AppData\Local\Temp\ipykernel_17668\1636443366.py in &amp;lt;cell line: 1&amp;gt;()&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;----&amp;gt; 1 cloned_items = target_gis.content.clone_items(items=[item], preserve_item_id=True)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;2 cloned_items&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\gis\__init__.py in clone_items(self, items, folder, item_extent, use_org_basemap, copy_data, copy_global_ids, search_existing_items, item_mapping, group_mapping, owner, preserve_item_id)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;7887 preserve_item_id = False&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;7888 &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;-&amp;gt; 7889 deep_cloner = clone._DeepCloner(&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;7890 self._gis,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;7891 items,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\_impl\common\_clone.py in __init__(self, target, items, folder, item_extent, service_extent, use_org_basemap, copy_data, copy_global_ids, search_existing_items, item_mapping, group_mapping, owner, preserve_item_id)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;106 self._temp_dir = tempfile.TemporaryDirectory()&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;107 # parse the config and get values&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;--&amp;gt; 108 self._create_graph()&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;109 self._cloned_items = []&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;110&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\_impl\common\_clone.py in _create_graph(self)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;118 user = self.target.users.me&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;119 # Get the definitions associated with the item&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;--&amp;gt; 120 self._get_item_definitions(item)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;121 &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;122 # Test if the user has the correct privileges to create the items requested&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\_impl\common\_clone.py in _get_item_definitions(self, item)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;987 # All other types we no longer need to recursively look for related items&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;988 else:&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;--&amp;gt; 989 item_definition = self._get_item_definition(item)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;990 self._graph[item.id] = item_definition&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;991&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\_impl\common\_clone.py in _get_item_definition(self, item)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;1611 )&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;1612 &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;-&amp;gt; 1613 return _WebExperience(&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;1614 self.target,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;1615 self._clone_mapping,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\_impl\common\_itemdef\_expbuilder.py in __init__(self, target, clone_mapping, info, data, sharing, thumbnail, portal_item, folder, item_extent, search_existing, owner, **kwargs)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;25 **kwargs,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;26 &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;---&amp;gt; 27 super().__init__(target, clone_mapping, search_existing)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;28 self.info = info&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;29 self._preserve_item_id = kwargs.pop("preserve_item_id", False)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\_impl\common\_clone.py in __init__(self, target, clone_mapping, info, data, sharing, thumbnail, portal_item, folder, item_extent, search_existing, owner, **kwargs)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;1987 self.item_extent = item_extent&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;1988 self.created_items = []&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;-&amp;gt; 1989 self.metadata_xml = portal_item.metadata&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;1990 &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;1991 @property&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;AttributeError: 'NoneType' object has no attribute 'metadata'&lt;/FONT&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;Any ideas?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jun 2024 00:18:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/clone-items-doesn-t-work-with-arcgis-enterprise/m-p/1487973#M10146</guid>
      <dc:creator>BBowers_napacounty</dc:creator>
      <dc:date>2024-06-10T00:18:39Z</dc:date>
    </item>
    <item>
      <title>Re: clone_items() doesn't work with ArcGIS Enterprise Portal 11.1?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/clone-items-doesn-t-work-with-arcgis-enterprise/m-p/1494463#M10208</link>
      <description>&lt;P&gt;Hey BBowers,&lt;/P&gt;&lt;P&gt;Can I just double check if this item is for an Experience Builder application?&lt;/P&gt;&lt;P&gt;Based on the error message it seems like the notebook is not successfully retrieving the item for cloning. Based on this I have a suspicion that this might be to do with the &lt;A href="https://developers.arcgis.com/rest/enterprise-administration/server/iteminfo/#:~:text=The%20iteminfo%20resource%20stores%20metadata,by%20the%20schema%20described%20below." target="_self"&gt;iteminfo.xml&lt;/A&gt; that is part of the application that would host the metadata. It might be worth finding this file and putting it into an XML validation tool to see if this is the case. By default you can find this file under&amp;nbsp;&lt;EM&gt;C:\arcgis\arcgisportal\content\items&lt;/EM&gt;.&lt;/P&gt;&lt;P&gt;I would also check if other Experience or item types are successfully cloning such as Hosted Feature Layers.&lt;/P&gt;&lt;P&gt;Hope that helps,&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jun 2024 16:13:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/clone-items-doesn-t-work-with-arcgis-enterprise/m-p/1494463#M10208</guid>
      <dc:creator>David_McRitchie</dc:creator>
      <dc:date>2024-06-18T16:13:23Z</dc:date>
    </item>
  </channel>
</rss>

