<?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: 'str' object has no attribute in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/str-object-has-no-attribute/m-p/1053492#M6004</link>
    <description>&lt;P&gt;It looks like you may have left out a crucial line from the script&amp;nbsp; (&lt;A href="https://support.esri.com/en/technical-article/000022252" target="_blank" rel="noopener"&gt;Link&lt;/A&gt;)&amp;nbsp;:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;items = gis.content.get(itemid)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If gis is your target and gis2 is your source then it should be:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;items = gis2.content.get(itemid)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from arcgis.gis import GIS
gis = GIS(&amp;lt;Put your URL here&amp;gt;) # Where it is going to
gis2 = GIS(&amp;lt;Put your URL here&amp;gt;) # Where it is coming from
itemid = '&amp;lt;Put your ID here&amp;gt;' # The item ID to clone
items = gis2.content.get(itemid) 
def deep_copy_content(input_list):
    for item in input_list:
        try:
            print("Cloning " + item.title)
            copy_list = []
            copy_list.append(item)
            gis.content.clone_items(copy_list, copy_data=True, search_existing_items=True)
            print("Successfully cloned " + item.title)
        except Exception as e:
            print(e)
    print("The function has completed")
deep_copy_content(items)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 01 May 2021 00:28:32 GMT</pubDate>
    <dc:creator>Tim_McGinnes</dc:creator>
    <dc:date>2021-05-01T00:28:32Z</dc:date>
    <item>
      <title>'str' object has no attribute</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/str-object-has-no-attribute/m-p/1053478#M6002</link>
      <description>&lt;P&gt;Searching through the other messages hasn't helped me with this.&amp;nbsp; I like to figure things out on my own, but I'm stumped.&amp;nbsp; I copied the deep_copy_content part below from a technical article, and only changed item.title to itemid and switched "gis" and "gis2".&amp;nbsp; Otherwise it's the same.&amp;nbsp; "gis" is my target location.&lt;/P&gt;&lt;P&gt;Here's what I'm seeing.&amp;nbsp; I appreciate any suggestions.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="CherylCollins_0-1619823071698.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/12335i6517511BDBDBA22E/image-size/large?v=v2&amp;amp;px=999" role="button" title="CherylCollins_0-1619823071698.png" alt="CherylCollins_0-1619823071698.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Apr 2021 22:55:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/str-object-has-no-attribute/m-p/1053478#M6002</guid>
      <dc:creator>CherylCollins</dc:creator>
      <dc:date>2021-04-30T22:55:37Z</dc:date>
    </item>
    <item>
      <title>Re: 'str' object has no attribute</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/str-object-has-no-attribute/m-p/1053491#M6003</link>
      <description>&lt;P&gt;The clone_items function takes a list of Items. It seems like you are passing in the string item ids instead.&lt;/P&gt;&lt;P&gt;It looks like you didn't include the code that initializes the items array so I can't tell if that's the actual issue.&lt;/P&gt;&lt;P&gt;Try something like:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;itemid = "xxxxx"

# Fetch item from gis
item = gis.content.get(itemid)

# Clone to gis2
gis2.content.clone_items([item], copy_date=True, search_existing_items=True)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 01 May 2021 00:18:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/str-object-has-no-attribute/m-p/1053491#M6003</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-05-01T00:18:51Z</dc:date>
    </item>
    <item>
      <title>Re: 'str' object has no attribute</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/str-object-has-no-attribute/m-p/1053492#M6004</link>
      <description>&lt;P&gt;It looks like you may have left out a crucial line from the script&amp;nbsp; (&lt;A href="https://support.esri.com/en/technical-article/000022252" target="_blank" rel="noopener"&gt;Link&lt;/A&gt;)&amp;nbsp;:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;items = gis.content.get(itemid)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If gis is your target and gis2 is your source then it should be:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;items = gis2.content.get(itemid)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from arcgis.gis import GIS
gis = GIS(&amp;lt;Put your URL here&amp;gt;) # Where it is going to
gis2 = GIS(&amp;lt;Put your URL here&amp;gt;) # Where it is coming from
itemid = '&amp;lt;Put your ID here&amp;gt;' # The item ID to clone
items = gis2.content.get(itemid) 
def deep_copy_content(input_list):
    for item in input_list:
        try:
            print("Cloning " + item.title)
            copy_list = []
            copy_list.append(item)
            gis.content.clone_items(copy_list, copy_data=True, search_existing_items=True)
            print("Successfully cloned " + item.title)
        except Exception as e:
            print(e)
    print("The function has completed")
deep_copy_content(items)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 01 May 2021 00:28:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/str-object-has-no-attribute/m-p/1053492#M6004</guid>
      <dc:creator>Tim_McGinnes</dc:creator>
      <dc:date>2021-05-01T00:28:32Z</dc:date>
    </item>
    <item>
      <title>Re: 'str' object has no attribute</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/str-object-has-no-attribute/m-p/1053495#M6005</link>
      <description>&lt;P&gt;Got it! What worked was adding &lt;STRONG&gt;item =&lt;/STRONG&gt; before &lt;STRONG&gt;gis.content.get&lt;/STRONG&gt; and replacing &lt;STRONG&gt;copy_list&lt;/STRONG&gt; with &lt;STRONG&gt;[item]&lt;/STRONG&gt;. I also got an error message about copy_data=True, but I just deleted that and it worked. Thanks for the help. I'm attaching the whole final script.&amp;nbsp; Tim_McGinnes also suggested part of the same answer.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 01 May 2021 01:43:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/str-object-has-no-attribute/m-p/1053495#M6005</guid>
      <dc:creator>CherylCollins</dc:creator>
      <dc:date>2021-05-01T01:43:29Z</dc:date>
    </item>
    <item>
      <title>Re: 'str' object has no attribute</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/str-object-has-no-attribute/m-p/1097815#M6628</link>
      <description>&lt;P&gt;I'm running into a similar error with my code attempting to do the same thing.&amp;nbsp;&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/32967"&gt;@CherylCollins&lt;/a&gt;&amp;nbsp;could you post your final code one more time?&amp;nbsp; I'm curious if your last line of code is "deep_copy_content(items)" or "deep_copy_content(item)".&amp;nbsp; Thanks so much!&lt;/P&gt;</description>
      <pubDate>Mon, 13 Sep 2021 22:02:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/str-object-has-no-attribute/m-p/1097815#M6628</guid>
      <dc:creator>JoshSender2</dc:creator>
      <dc:date>2021-09-13T22:02:08Z</dc:date>
    </item>
    <item>
      <title>Re: 'str' object has no attribute</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/str-object-has-no-attribute/m-p/1097817#M6629</link>
      <description>Unfortunately, I never got the whole thing to work. I ended up buying to two one-month subscriptions to Admin Tools so I could finally copy over the Story Maps, and even that was not without its problems. I think ESRI really needs to make it easier to transfer Story Maps between organizations. We could be designing great stuff for our clients, but it's not happening.&lt;BR /&gt;</description>
      <pubDate>Mon, 13 Sep 2021 22:21:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/str-object-has-no-attribute/m-p/1097817#M6629</guid>
      <dc:creator>CherylCollins</dc:creator>
      <dc:date>2021-09-13T22:21:01Z</dc:date>
    </item>
    <item>
      <title>Re: 'str' object has no attribute</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/str-object-has-no-attribute/m-p/1098062#M6631</link>
      <description>&lt;P&gt;Got it.&amp;nbsp; Yeah that's possibly where I'm heading soon as well.&amp;nbsp; I also have an open case with ESRI Support staff for this issue.&amp;nbsp; If anything comes out of that, I'll be sure to update here.&amp;nbsp; Thanks for the info!&lt;/P&gt;</description>
      <pubDate>Tue, 14 Sep 2021 14:40:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/str-object-has-no-attribute/m-p/1098062#M6631</guid>
      <dc:creator>JoshSender2</dc:creator>
      <dc:date>2021-09-14T14:40:51Z</dc:date>
    </item>
  </channel>
</rss>

