1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-12-03 17:36:05 +00:00

feat(appsettings): the panel backup dumps a PostgreSQL database

With PostgreSQL the daily backup left the database out and only warned. It now
writes a pg_dump in its custom format as db.pgdump and fails when pg_dump is
missing or the dump fails. The Docker image ships postgresql-client; the restore
and move steps say how to put the dump back.
This commit is contained in:
catborise 2026-11-25 13:56:04 +03:00
parent b4c7ecddc4
commit 2b5d0ac80e
6 changed files with 67 additions and 19 deletions

View file

@ -7,7 +7,8 @@
The panel backs itself up every day at 03:15 (cron in Docker; otherwise `webvirt-backup.timer`, within 10 minutes after and at the next boot if the server was off) into a new directory under `/srv/webvirtcloud/backups`, in Docker the `webvirtcloud-backups` volume, and keeps the newest 7. A backup holds:
- `db.sqlite3`: a consistent copy taken while the panel runs, checked with `PRAGMA integrity_check`; with PostgreSQL it is left out, so back up that database yourself
- `db.sqlite3`: a consistent copy taken while the panel runs, checked with `PRAGMA integrity_check`
- `db.pgdump` instead, with PostgreSQL: a `pg_dump` of the database in its custom format. The Docker image has `pg_dump`; otherwise install the PostgreSQL client (`postgresql-client` on Debian and Ubuntu, `postgresql` on RHEL), of the server's major version or newer. Without it the backup fails
- `secret_key`, `node_id` and `local_settings.py`
- `ssh/`: the SSH keys of the panel's user, which the SSH computes accept
- `pki/`: the TLS client certificates of the panel's user, which the TLS computes accept