Select to view content in your preferred language

Error when try to Clone Hub/Site to another organisation

585
1
Jump to solution
11-10-2023 02:26 AM
Labels (1)
victorCanut
Occasional Contributor

I want to clone an ArcGIS Hub from an organisation to another with Python but i have an error.
I have try this :

source_Hub = source_gis.hub
target_hub = target_gis.hub
sud_patri = source_Hub.sites.get(id)
target_hub.sites.clone(sud_patri)

Also i just try to create un new site with :

cloned_sudpatri = target_hub.sites.add(title=sud_patri.title)

But I have the same error :

---------------------------------------------------------------------------
Exception                                 Traceback (most recent call last)
~\AppData\Local\Temp\ipykernel_17328\1956000436.py in <cell line: 1>()
----> 1 cloned_sudpatri = target_hub.sites.add(title=sud_patri.title)

e:\ArcGIS\conda\envs\arcpy3_gp\lib\site-packages\arcgis\apps\hub\sites.py in add(self, title, subdomain)
   1057 
   1058         # Register site and update its data
-> 1059         _data = self._create_and_register_site(
   1060             site, subdomain, _site_data, content_group_id, collab_group_id
   1061         )

e:\ArcGIS\conda\envs\arcpy3_gp\lib\site-packages\arcgis\apps\hub\sites.py in _create_and_register_site(self, site, subdomain, site_data, content_group_id, collab_group_id)
    697         if self._gis._portal.is_arcgisonline:
    698             # register site as an app
--> 699             _app_dict = site.register(app_type="browser", redirect_uris=[site.url])
    700             client_key = _app_dict["client_id"]
    701 

e:\ArcGIS\conda\envs\arcpy3_gp\lib\site-packages\arcgis\gis\__init__.py in register(self, app_type, redirect_uris, http_referers, privileges)
  16248             params["privileges"] = privileges
  16249         url = "%soauth2/registerApp" % self._portal.resturl
> 16250         res = self._portal.con.post(url, params)
  16251         self._hydrated = False
  16252         self._hydrate()
...
   1053 
   1054     def post_multipart(

Exception: Request signature does not match. The request has to be signed.
(Error Code: 400)


If someone have en idea or a valid method to clone a Hub/Site, i'm interrested.

Thank's

Tags (3)
0 Kudos
1 Solution

Accepted Solutions
victorCanut
Occasional Contributor

I have resolve my error with specify active GIS.

from arcgis.env import active_gis
active_gis = target_gis

 

View solution in original post

0 Kudos
1 Reply
victorCanut
Occasional Contributor

I have resolve my error with specify active GIS.

from arcgis.env import active_gis
active_gis = target_gis

 

0 Kudos