Can you use clone_items to move items from one portal to another?

2767
2
Jump to solution
04-09-2018 03:21 PM
JamesGustine
New Contributor III

Will this work for moving items from one portal to another?  

arcgis.gis module — arcgis 1.4.0 documentation 

If not, is there a copy_items with a source and target?

Thanks!

0 Kudos
1 Solution

Accepted Solutions
AaronPulver
Esri Regular Contributor

The ago-clone-items repo is deprecated since the functionality was moved into the Python API.

You can use the Python API to deep clone items and their dependencies using "clone_items" like the following:

source_gis = arcgis.gis.GIS("https://arcgis.com","username","password")

target_gis = arcgis.gis.GIS("https://server.com/portal", "username","password")

item = source_gis.content.get("<item-id>")

target_gis.content.clone_items([item])

View solution in original post

2 Replies
DerekLaw
Esri Community Moderator
0 Kudos
AaronPulver
Esri Regular Contributor

The ago-clone-items repo is deprecated since the functionality was moved into the Python API.

You can use the Python API to deep clone items and their dependencies using "clone_items" like the following:

source_gis = arcgis.gis.GIS("https://arcgis.com","username","password")

target_gis = arcgis.gis.GIS("https://server.com/portal", "username","password")

item = source_gis.content.get("<item-id>")

target_gis.content.clone_items([item])