69 lines
1.8 KiB
Markdown
69 lines
1.8 KiB
Markdown
Vikunja Docker Backup and Restore Utilities
|
|
|
|
These scripts are designed to simplify the management of your Vikunja Docker installation which uses local volumes (db and files).
|
|
|
|
⚠️ PREREQUISITES AND WARNINGS:
|
|
|
|
Ensure both scripts (backup.sh and restore.sh) are in the same directory as your docker-compose.yml file.
|
|
|
|
Run the following command once to make both scripts executable:
|
|
|
|
chmod +x *.sh
|
|
|
|
|
|
The restore script is a DESTRUCTIVE action. It permanently deletes the current db and files directories before restoring data. Use with caution.
|
|
|
|
1. Backup Script (backup.sh)
|
|
|
|
This script is used to safely create a consistent, compressed snapshot of your application and data.
|
|
|
|
Process
|
|
|
|
Stops the running Vikunja and MariaDB containers (docker compose down).
|
|
|
|
Creates the ./backup directory if it doesn't exist.
|
|
|
|
Archives docker-compose.yml, the db/ folder (MariaDB data), and the files/ folder (Vikunja attachments).
|
|
|
|
Restarts the services (docker compose up -d).
|
|
|
|
Usage
|
|
|
|
./backup.sh
|
|
|
|
|
|
Output
|
|
|
|
Backups are placed in the ./backup directory with a timestamped filename, e.g., vikunja_backup_YYYYMMDD_HHMMSS.tar.gz.
|
|
|
|
2. Restore Script (restore.sh)
|
|
|
|
This script is used to revert your application to a previous state from one of your backup archives.
|
|
|
|
Process
|
|
|
|
Lists all available backup files in the ./backup folder.
|
|
|
|
Prompts the user to enter the full filename of the desired backup.
|
|
|
|
Stops the running containers.
|
|
|
|
DELETES the current db and files data directories.
|
|
|
|
Extracts the contents of the selected archive into the current directory.
|
|
|
|
Restarts the services.
|
|
|
|
Usage
|
|
|
|
./restore.sh
|
|
|
|
|
|
The script will guide you through the file selection:
|
|
|
|
Available backup archives:
|
|
1) vikunja_backup_20251128_150000.tar.gz
|
|
2) vikunja_backup_20251129_201230.tar.gz
|
|
|
|
Enter the full filename of the backup you want to restore: vikunja_backup_20251129_201230.tar.gz
|