Backup ArcGIS Online content to a specified location.
Download GIS and other content from ArcGIS Online Organizations to create copies for backup and historical purposes. ArcGIS Online does not support archiving and history tracking like SDE databases so this process will provide that functionality.
ArcGIS Online Organizational Account
Python 3.7+ (version 3.7.10 used at time of writing) with libraries:
-- ArcGIS API for Python
-- dotenv
JupyterLab (installed via Conda) -- Used for development, will potentially be changed to run in base Python -- Note: JupyterLab has a lot of requirements and makes this script heavier than it needs to be
Prep data on ArcGIS Online or Enterprise
Clone (download) this project.
Create a Python environment for the project (strongly recommended).
conda create --name envname
which creates a new environment by default in C:\Users\username\Anaconda3\envs
Activate the new environment
conda activate envname
docs Install ArcGIS API for Python in the new Environment
conda install -c esri arcgis
Install dotenv
conda install -c conda-forge python-dotenv
Install JupyterLab (Optional)
conda install -c conda-forge jupyterlab
This project uses a hidden environment file named ".env" in the root directory. This file is ignored (by .gitignore method) so you must create this file in the root directory and add variable features.
Create .env
file
.env
in the root directory using the template. You can rename the template to .env
. Set Environment varaibles
Can be run as a Python file i.e. scheduled with Windows Task Scheduler or interactively in a Jupyter Lab notebooks.
Development was done in Jupyter Lab then exported to Python.
conda activate env-name
then cd path-to-project
then jupyter lab