Select to view content in your preferred language

Example to copy portal content

2411
7
Jump to solution
06-10-2017 12:40 AM
PhilipHughes
Emerging Contributor

trying to used the example listed in the site,  there a few typo errors that obvious however I getting a traceback error

Traceback (most recent call last):
  File "copy_to_mgq.py", line 398, in <module>
    target.content.create_folder(folder, user)
  File "C:\Continuum\Anaconda3\lib\site-packages\arcgis\gis.py", line 1665, in create_folder
    if self._portal.get_folder_id(owner_name, folder) is None:
  File "C:\Continuum\Anaconda3\lib\site-packages\arcgis\_impl\portalpy.py", line 2192, in get_folder_id
    if fldr['title'].upper() == folder_name.upper():  # Force both strings to upper case for comparison
AttributeError: 'dict' object has no attribute 'upper'

This is from the line "target.content.create_folder(folder, user)"  am guessing this a problem in the esri code

1 Solution

Accepted Solutions
RohitSingh2
Esri Contributor

Hi Philip, You can do to this link and save the file with extension (.ipynb) to download it:

https://raw.githubusercontent.com/Esri/arcgis-python-api/dev/samples/03_org_administrators/clone_por... 

The download the samples button is not for downloading the particular sample. 

View solution in original post

7 Replies
by Anonymous User
Not applicable

Philip, we have fixed this error. It would be a while before the site is updated, meanwhile, you can check out the updated sample on github arcgis-python-api/clone_portal_users_groups_and_content.ipynb at dev · Esri/arcgis-python-api · GitH... 

PhilipHughes
Emerging Contributor

Thank you

Any chance of getting the samples to download, says 404 error page not found

0 Kudos
RohitSingh2
Esri Contributor

Hi Philip, You can do to this link and save the file with extension (.ipynb) to download it:

https://raw.githubusercontent.com/Esri/arcgis-python-api/dev/samples/03_org_administrators/clone_por... 

The download the samples button is not for downloading the particular sample. 

PhilipHughes
Emerging Contributor

Thank you,  got the script,  now running, next problem is

when copying item

           target_item = target.content.add(item_properties, data_file, thumbnail_file,
                                             metadata_file, source_item.owner, folder_name)

Getting occasional error

HTTP error 413: Request Entity Too Large

Is this fixed or is there a constant that can be set.

0 Kudos
PhilipHughes
Emerging Contributor

Also getting an error copying item

invalid json  in 'text' parameter

0 Kudos
RohitSingh2
Esri Contributor

What's the json being passed in the text parameter. You can check its validity using the tool at https://jsonformatter.curiousconcept.com/  

0 Kudos
PhilipHughes
Emerging Contributor

This is the problem,  I am trying to run one of the ESRI samples that copies from one portal to another.  I will have to try and modify code to see if I can dump the data.

0 Kudos