Correct syntax for GroupMigrationManager

682
1
10-06-2020 06:23 AM
EricAnderson_DHS
Occasional Contributor

Hello,


We recently upgraded our Enterprise environment to 10.8.1 and are looking forward to taking advantage of the GroupMigrationManager tools within the ArcGIS API for Python. 

However, the documentation linked above is lacking. I am unsure what the proper syntax would be to export and then import the group content EPK file. 

The following seems to work:

gis = GIS(PORTALURL,USERNAME,PASSWORD)

grp = gis.groups.get("<GROUPID>")
grpmgr = arcgis.gis.GroupMigrationManager(grp)
grpcnt = grpmgr.create()

This creates a new folder in my Content called "exports" and has an EPK item. However, there is no way to download this file through the UI. When I use the following to try and load this into a different 10.8.1 Portal, I get the error following:

gis = GIS(PORTALURL2,USERNAME,PASSWORD)

grp = gis.groups.get("<GROUPID>")
grpmgr = arcgis.gis.GroupMigrationManager(grp)
grpcnt = grpmgr.load(epk_file=grpcnt)

Traceback (most recent call last):
File "C:\AdminScripts\GroupMigration.py", line 9, in <module>
grpcnt = grpmgr.load(epk_item=grpcnt)
File "C:\....\__init__.py", line 1305, in load
assert isinstance(epk_item, Item)
AssertionError

Can anyone please help explain what the proper syntax is to export and then import these EPK files? I wish the documentation provided better examples.

Thank you in advance.

0 Kudos
1 Reply
NicolasGIS
Occasional Contributor III

Yes, you can download on the following url:

 
avec EPK_ITEM_ID, l'id de l'item .epk.
 
Hope that help.
 
On my side I cannot make the import works using ArcGIS for Python I face another issue.
I have to do it manually on the REST API:
 
Hope that helps
0 Kudos