Hi,
I am busy experimenting with cloning content from ArcGIS Online to Portal, using this very useful page:
https://developers.arcgis.com/python/guide/cloning-content/#the-cloning-process
However, I am running into a piec of caode that does not work, it's the piece where hosted feature layers are cloned into a recreated folder structure, where it's the last part, recreating the folder structure, that's giving me problems. More specifically, it is this piece of code:
for hfs in hosted_fsvc:
try:
if hfs.ownerFolder:
folder = next((f['title']
for f in source.users.me.folders
if f['id'] == hfs.ownerFolder))
I suppose this code should loop throught all folders, for every hosted feature layer, and find the one where the layer resides. However, source.users.me.folders will only find the folders that my admin user is the owner (or creator?) of.
So the question is, how would I loopt through ALL folders?
Regards,
Joris Frenkel