Many data layers are constantly being updated and moved. A method to backup essential data is crucial to sustaining the Southern African Wildlife College’s GIS. ArcGIS Notebooks provides an easy-to-use interface to automate processes. It runs on ArcGIS Online (AGOL), making it easy to access data. This can be set as a task to be run as needed or run manually.
ArcGIS Notebooks requires the use of item ids to access information on items. Creating a list of ids was found to be too time consuming and would cause the code to be messy. Instead, every layer is saved with the tag ‘Backup’. The backup script searched for this tag, and created a list of all the ids that will be backed up.
The code exported each layer to a file geodatabase in the contents of AGOL. However, there is some error handling to prevent downloading of view layers, which are duplicates of feature layers. The script also showed a message if the user tries to download a file without an item id, such as a web map. The script counted and printed out how many items were downloaded in a message.
Notebooks did not have a way for the script to automatically download to the local machine. Therefore, the user must download each layer manually via links. The script prints out each link, prompting the user to download each item.
The user will be required to interact with the script for this code. The backup script prompted the user to enter ‘y’ if they have downloaded all the layers, or ‘n’ if they have not. If they have downloaded the file geodatabases, the new file geodatabases in AGOL will be deleted to save space. If not, the user will be shown the links again.