agrc / palletjack

A library for updating AGOL data from various external sources
MIT License
12 stars 0 forks source link

Backup layers before truncating #91

Open jacobdadams opened 1 month ago

jacobdadams commented 1 month ago

Add the option to backup layers to AGOL as feature collections (maybe gdbs?) prior to truncating and then try to restore if load fails.

backup_fc_item = materials_original_item.export(title="Materials Table Backup", export_format="Feature Collection")
materials_original_item.tables[0].manager.truncate(asynchronous=True, wait=True)
materials_original_item.tables[0].append(backup_fc_item.itemid, upload_format="featureCollection")