I'm trying to clone items from our AGO to our organizations enterprise Portal and vice versa. When connecting to my AGO account through the notebook it seems to work just fine. It alerts me that I am logged in as an administrator. When connecting to my Portal account it throws a number of errors including a connection error. Do I need to be an administrator to complete the cloning? Is there any issue with our portal being behind a firewall? and lastly, is an advanced license of Notebook server required for this? Are any of the ArcPy modules required for the cloning process? We currently only have a standard server license. Any help on this topic is appreciated.
Clone items is done through the Python API and does not use arcpy modules, so no you don't need to have an advanced license to run it. You don't need to be an administrator for either system, but it often helps cut down on permission issues that can come up. When attempting to connect to your Enterprise Portal, are you doing that from Notebooks in ArcGIS Online? If so, is your Enterprise Portal public facing?
If your Portal is not public facing, then using Notebooks in ArcGIS Online won't work. ArcGIS Online has no way to find your Portal behind a firewall. With that being said, you can use Jupyter Notebooks from ArcGIS Pro on a machine within your network that can access your Portal and ArcGIS Online. All the functions will be the same from the Notebooks in AGOL and Pro, and this would solve the connection errors you are seeing.
Hey @ReeseFacendini ,
Thanks for the info! I'm using notebooks within ArcPro on a machine within our network. After trying to connect to our Portal, I receive this message.
I'm on step 2 of this guide - https://support.esri.com/en/technical-article/000022252
I've entered my portal URL and my username and password.
Is there something different I should be doing or does something need to happen on the Portal end to enable access?
Hi @DaveK, yes there is one parameter you need to add to that connection string. Add the verify_cert=False piece to the end of the GIS line (see below). This will tell the Python API to not try and validate the SSL certificate.
cnx = GIS(url=portalURL, username=portalUser, password=portalPass, verify_cert=False)
I think you are passing a full list, where clone_items wants a single object. I suggest iterating through your list of items to be copied and calling clone_items for each iteration
The line where you are calling clone_items within the try / except block, you are passing a list (even though it only has a single item in it). Change the line to read "gis2.content.clone_items(item, copy_data=True, search_existing_items=True)