3 KiB
Backup and Restore Procedures
Last updated: 2025-12-13
This document outlines the procedures for backing up and restoring services and their data.
Service Directory Backups
The primary method for backing up a service's configuration and data is by using the archiveme.sh script. This script creates a compressed tar.gz archive of a service's directory from /mnt/docker-storage/appdata and moves it to /volume1/docker/Archived configuration.
How to Back Up a Service
-
Navigate to the
appdatadirectory:cd /mnt/docker-storage/appdata -
Run the
archiveme.shscript:./archiveme.sh <service-name>For example, to back up the
embyservice:./archiveme.sh emby -
Follow the prompts: The script will compress the directory and then ask if you want to delete the source folder. It is recommended to keep the source folder unless you are decommissioning the service.
How to Restore a Service
-
Locate the backup file: The backup files are located in
/volume1/docker/Archived configuration. -
Extract the backup:
tar -xzf /volume1/docker/Archived\ configuration/<archive-name>.tar.gz -C /mnt/docker-storage/appdata/This will extract the service's directory into the
appdatadirectory. -
Start the service:
cd /mnt/docker-storage/appdata/<service-name> docker-compose up -d
Database Backups
MariaDB/MySQL
The central MariaDB server on 192.168.1.251 should have its own backup strategy. However, you can also create a manual backup of a specific database using mysqldump.
Backup:
mysqldump -h 192.168.1.251 -u <user> -p <database-name> > <database-name>.sql
Restore:
mysql -h 192.168.1.251 -u <user> -p <database-name> < <database-name>.sql
PostgreSQL (Docker Containers)
For PostgreSQL databases running in Docker containers, you can use pg_dump to create a backup.
Backup:
docker-compose exec -T <db-container-name> pg_dumpall -c -U <user> > dump.sql
For example, to back up the mealie database:
docker-compose -f /mnt/docker-storage/appdata/mealie/docker-compose.yaml exec -T mealie_postgres pg_dumpall -c -U mealie > mealie_dump.sql
Restore:
cat mealie_dump.sql | docker-compose -f /mnt/docker-storage/appdata/mealie/docker-compose.yaml exec -T mealie_postgres psql -U mealie
SQLite
SQLite databases are single files. The archiveme.sh script automatically backs up these files as part of the service directory backup. To restore a SQLite database, you just need to restore the service directory.
Automated Backups
The archiveme.sh script is a manual process. For automated backups, consider using a tool like ArchiveForge, which is already running on this system. ArchiveForge can be configured to automatically back up service directories on a schedule.
Refer to the ArchiveForge documentation for more details on its configuration.