feat(scripts): add backup/restore scripts

This commit is contained in:
2026-06-05 13:29:30 +03:30
parent 863cbd9ec9
commit 9f7accba04
5 changed files with 291 additions and 0 deletions

View File

@@ -234,6 +234,35 @@ Stop everything:
docker compose down
```
Backup the deployed data:
```bash
chmod +x ./scripts/backup.sh
./scripts/backup.sh
```
By default, backup archives are written to `./backups/`. Each archive contains:
- PostgreSQL data from the `db` service
- media files from the Docker media volume
- `.env` files from the deployment, backend, and frontend projects
Restore a backup archive on another machine:
```bash
chmod +x ./scripts/restore.sh
./scripts/restore.sh ./backups/qlockify-backup-YYYYMMDD-HHMMSS.tar.gz
docker compose up -d --build
```
Restore is destructive for the database by default. To restore only part of an archive, use:
```bash
RESTORE_SKIP_DB=1 ./scripts/restore.sh ./backups/qlockify-backup-YYYYMMDD-HHMMSS.tar.gz
RESTORE_SKIP_MEDIA=1 ./scripts/restore.sh ./backups/qlockify-backup-YYYYMMDD-HHMMSS.tar.gz
RESTORE_SKIP_ENV=1 ./scripts/restore.sh ./backups/qlockify-backup-YYYYMMDD-HHMMSS.tar.gz
```
## CI/CD with Gitea Actions
This repository now ships with a Gitea Actions deployment workflow in: