Hey Josh, Thanks for this! And no worries about the slow reply - I've only just revisited this. I've developed the code a little more so it reads through my content and exports certain item types. It works for the most part but there are a few that fail with the error exportItemId. Do you know what this means and what I need to do to my code to troubleshoot this? I've attached the last cell in my code below and an example of one of the failed error messages. for data_item in useful: print("\nProcessing: " + data_item.title) try: result = data_item.export(data_item.title, "File Geodatabase") result.download(path) except Exception as e: print ("Error occurred \n",e) Processing: Local Routes Error occurred 'exportItemId'
... View more
I've been working through this post to try to download/backup my feature hosted layer(s) to gdb onto my local machine from ArcGIS Online using Notebook but it is not working. I can easily create a backup in a user's/my contents online but it does not work when I try and download the files to my desktop or similar. My code is below (excluding personal info) - it doesn't error it just doesn't really do anything?! I'm very very new to this so appreciate its a bit clunky. Any tips greatly appreciated! #import modules from arcgis.gis import GIS from arcgis.features import manage_data import time, os, fnmatch, shutil from pathlib import Path gis = GIS(username="Username", password="Password") item_id = 'itemid' data_item = gis.content.get(item_id) data_item data_item.title fgdb_title = data_item.title t = time.localtime() timestamp = time.strftime('%d%b%Y_%H%M',t) result = data_item.export(fgdb_title + ' ' + timestamp, "File Geodatabase") result data_path = Path(r'C:\Users\name\Desktop\backup') if not data_path.exists(): data_path.mkdir() extract_path = data_path.joinpath('export') result.download(save_path=data_path) result.download
... View more