I am trying to copy/clone items from one portal to another. We have a QA portal and a prod portal. Since I hit dead end with the copy content script, I switched to using clone_items from the ArcGIS API for Python.
While the scripts appears to clone the items, meaning in most cases an item will appear in the Prod Portal, but unfortunately they don't always work. I am currently working on two 10.5.1 portals, but the problem seems to persist.
Failed clones - Type of file and error
Successful clones - Type of file
We would like to be able to easily transfer users content from one to the other. Right now that only seems to be possible if we use services from ArcGIS Server, but not if the users create their own content using in ArcGIS Pro and uses MapImages. Do you guys have the same problem and how did you resolve it?
I am not sure whether it is a Portal settings issue, or that maybe clone_items is only intended to work for certain file types?
Any help you may be able to provide is greatly appreciated!
Hi James Osundwa,
No, unfortunately. Apparently it is possible if you are willing to allow anonymous authentication, but unfortunately that is not an option for us.
ESRI recommends republishing everything regardless and they admit clone item and copy content doesn't always work. Our workflow would probably be something like this:
It is a little more work, but not too bad. In some ways I think it defeats the purpose of having both a QA and Prod Portal, you way as well share it with a small group on Prod and then release it to everyone after.
I don't know if that helps at all. Feel free to contact me if you have any other questions.
Hi Morten Olesen, a year later has anything changed? Or have you dropped this all together. We have the same needs, starting with the sample python, etc. Example: Copy content—Portal for ArcGIS (10.6) | ArcGIS Enterprise
First glance shows that our layers are copying, but web maps are pointing to source portal and not the destination portal.
I haven't looked into it since, so I am not sure if anything has changed. I seem to remember something similar to the behaviour you are describing. We are not using Portal much unfortunately as most clients seem to want something custom. I should look into the 10.7 features and see if they have made any improvements.
You'll need to update the webmaps JSON either before or after moving it over. The Python API also has samples for cloning:
For example, in the Copy Items section, when it's checking whether it's a TEXT_BASED_ITEM_TYPE, you can check if it's a webmap and then find/replace all URLs within the webmap.
Is there a limitation on how many records can be cloned () in a feature layer? I've been successful cloning two features from AGOL to Portal with <1,000 records, but I get the "_ItemCreateException: ('Failed to create Feature Service..." error when attempting to "clone_content" for a layer with ~13,000 records. When I set copy_data=False I get it to Portal with no records, so I'm assuming its the record count? I am using the "content.clone_items" api module..