feat(scripts): add backup/restore scripts
This commit is contained in:
29
README.md
29
README.md
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user