We are working on disaster recovery: we would like a Python API for ArcGIS script to (1) export all Hosted Feature Layers (HFLs) to File Geodatabases (FGDBs), and (2) download the FGDB to the local file system.
Many of the HFLs have layers with attachments. We do not want to include the attachments in the exported FGDB.
We are working with code that looks like this:
the_query = "type:Feature Service AND NOT typekeywords:View Service"
some_content = gis.content.search(query=the_query, max_items=10000, outside_org=False)
for an_item in some_content:
the_Title = "{s} GDB".format(s=an_item.name)
try:
output_file = an_item.export(title=the_Title, export_format="File Geodatabase", wait=True)
file_location = output_file.download(r'ArcGISOnlineBackup')
delete_result =output_file.delete()
Mostly this does what we want except there are attachments.
My question: Is there a way to perform the export without the attachments?
I know I can do it with Shapefiles and I know I can do it with ArcPy. Neither is an option.
TIA