Promoting QuickCapture Projects between Portals

930
1
07-17-2020 01:24 PM
BrianKingery
New Contributor II

I am attempting to migrate QuickCapture projects from one Portal environment to a higher Portal environment. When ready to promote the app from Dev to Staging and then to Production environment, what is the best method? Do we have to manually re-create that app in the higher environments? Thanks for the help!

For other Portal items, we are using https://ago-assistant.esri.com/# successfully to migrate layers, maps, and apps by copying the items from lower to higher environments and then updating the JSON of the various items. That option isn’t available from the JSON for QuickCapture projects and nothing happens when I click the download link.

I tried copy/pasting the Project source JSON from inside of the QuickCapture Project Builder UI from Dev into a newly created blank project in a higher environment and then modifying the text at the beginning of the section of code, but that didn’t go well as it didn’t carry over images that were used.

Any thoughts? Thanks in advance.

0 Kudos
1 Reply
JohnathanHasthorpe
Esri Regular Contributor

You can use the Python ArcGIS API's clone functionality: arcgis.gis module — arcgis 1.8.2 documentation to migrate projects from one portal to another. The following code will copy all QuickCapture projects (including layers referenced by the projects) from a defined group in a source portal => to the my content area of the target portal. This can be modified to meet your requirements:

Code (to copy):

from arcgis import GIS import arcgis  # Define source portal  source_gis = GIS(url='https://machine1/portal',                  username='portaladmin', password='password',                  set_active=False, verify_cert=False)  # Define destination portal  dest_gis = GIS(url='https://machine2/portal', username='portaladmin',                password='password', set_active=False,                verify_cert=False)  # Define source group  myGroup = source_gis.groups.search('QuickCapture Projects') myGroup[0] myGroupsStuff = myGroup[0].content() groupId = myGroup[0].id  # Loop through QuickCapture Project items in group  for item in myGroupsStuff:      try:         if item.type == 'QuickCapture Project':             res = dest_gis.content.clone_items([item])             print 'Item: {} - Created in the target portal'.format(item.title)     except Exception, e:          print 'Item: {} - Could not be created in the target portal'.format(item.title)         print e

Thanks
John

0 Kudos