It's a good practice to backup your ArcGIS Enterprise in the event of failure or corruption. Doing so allows you to recover the portal items, services, and data that existed at the time you created the backup. This document and attached script will help you automate this procedure. Here are the steps:
Prerequisites
The python-dateutil module is required for this script to execute successfully. This module is not included with python that is installed with Portal. Follow the below steps to install this module.
1. Navigate to the following URL, copy all the text on the page, and paste into a text editor (i.e. Notepad++)
2. Save the file to Portal's python directory (i.e. C:\Program Files\ArcGIS\Portal\framework\runtime\python) as get-pip.py
3. Open a command prompt as an Administrator and navigate to Portal's python directory (i.e. C:\Program Files\ArcGIS\Portal\framework\runtime\python)
4. Run the following command:
python get-pip.py
5. After that installs, navigate to C:\Program Files\ArcGIS\Portal\framework\runtime\python\scripts:
6. Run the following command
pip install python-dateutil
Configure Script and BAT File
1. Following the steps in this help document, edit the webgisdr.properties file accordingly.
2. Once you have the webgisdr.properties file edited, update the variables in the attached WEBGISDR_Export_Full.py script.
- backupDirectory - should be the same as the BACKUP_LOCATION variable in the webgisdr.properties file
- previousBackups - a directory of your choose where you can store previous backups
- batFile - the path to a batch file (.bat) that this python script will execute
- days - the number of days to retain previous backups in the previous backups directory
3. Edit the attached WEBGISDR_Export_Full.bat file using a text editor (i.e. Notepad++)
- Line 2 - Specify a path to the webgisdr directory (i.e. C:\Program Files\ArcGIS\portal\tools\webgisdr)
- Line 3 - Specify the file parameter to the path where the webgisdr.properties file exists
4. Set up Windows Task Scheduler to execute the python script on a scheduled basis. It would be best to perform full backups while there is less traffic on your network, i.e. after business hours.
Note: Refer to this section of what's included in the backup, and what is not.
See a video of this workflow in the link below:
https://youtu.be/pP0tbxFeYAE