Backup and Restore#
Backing Up Sherpa Orchestrator (Docker)#
Instructions for creating a backup of the configuration and database in the Docker version of Sherpa Orchestrator.
1. Preparation#
Open a terminal on the server and navigate to the project installation directory.
cd /opt/SherpaOrchestrator
It is recommended to create a separate folder for the backup with the current date.
BACKUP_DIR=./backup_$(date +%Y%m%d_%H%M%S)
mkdir -p "$BACKUP_DIR"
2. Copying the .env File#
Copy the environment variables file.
cp ./.env "$BACKUP_DIR"/.env
3. Copying backend/config Settings#
Copy the backend configuration folder.
cp -r ./backend/config "$BACKUP_DIR"/backend_config
By default, the absolute path to this directory is:
- /opt/SherpaOrchestrator/backend/config
4. Copying nginx/config#
Copy the nginx configuration.
cp -r ./nginx/config "$BACKUP_DIR"/nginx_config
5. Creating a MariaDB Database Dump#
If the MariaDB profile is used, create a dump inside the container and copy it to the host.
docker exec orchestrator-db sh -c 'mysqldump -u root --max-allowed-packet=1G --single-transaction orchestrator > /orchestrator_db_dump.sql'
If the standard database credentials have been changed, use your own login and password.
docker exec -it orchestrator-db sh
mysqldump -u your_login -p --max-allowed-packet=1G --single-transaction orchestrator > /orchestrator_db_dump.sql
exit
Copy the dump to the host machine.
docker cp orchestrator-db:/orchestrator_db_dump.sql "$BACKUP_DIR"/orchestrator_mariadb_dump.sql
6. Creating a PostgreSQL Database Dump#
If the PostgreSQL profile is used, create a dump inside the container and copy it to the host.
docker exec orchestrator-pg sh -c 'PGPASSWORD=$POSTGRES_PASSWORD pg_dump -U postgres -d orchestrator -Fc -f /orchestrator_pg_dump.dump'
If different credentials are used, specify your user and the required database.
docker exec -it orchestrator-pg sh
export PGPASSWORD=your_password
pg_dump -U your_login -d orchestrator -Fc -f /orchestrator_pg_dump.dump
exit
Copy the dump to the host machine.
docker cp orchestrator-pg:/orchestrator_pg_dump.dump "$BACKUP_DIR"/orchestrator_postgres_dump.dump
7. Verifying Backup Contents#
Check that the backup directory contains:
- .env file
- backend_config directory
- nginx_config directory
- MariaDB dump or PostgreSQL dump (depending on the database profile used)
Example verification:
ls -la "$BACKUP_DIR"