Backups & upgrades
Where your data lives
Section titled “Where your data lives”Everything is in the folder mounted at /app/data:
data/├── pethealth.db # SQLite database (all records)├── backups/ # automatic snapshots└── uploads/ ├── photos/ # pet photos ├── pdfs/ # lab exam PDFs └── attachments/ # checkup and exam attachmentsUploaded files never change once written; they get random names and are deleted when their record is deleted.
Automatic backups
Section titled “Automatic backups”PetHealth takes a consistent snapshot of the database with SQLite’s online backup API, which is safe while the app is running:
- every
BACKUP_INTERVAL_HOURShours (default 24; checked hourly and at startup), - keeping the newest
BACKUP_KEEPfiles (default 7), - in
data/backups/pethealth-YYYYMMDD-HHMMSS-mmm.db.
Take one manually at any time:
docker exec pethealth npm run backupFull backup
Section titled “Full backup”Copying the whole data/ folder is a complete backup, since it holds the database and every upload. For a perfectly consistent copy, either stop the container first or copy the latest snapshot from data/backups/ together with uploads/.
docker compose stoptar czf pethealth-backup-$(date +%F).tar.gz datadocker compose startRestore
Section titled “Restore”docker compose down# Option A: restore a full copyrm -rf data && tar xzf pethealth-backup-2026-10-01.tar.gz# Option B: roll the database back to a snapshotrm -f data/pethealth.db-wal data/pethealth.db-shmcp data/backups/pethealth-20261001-080000-123.db data/pethealth.dbdocker compose up -dPetHealth runs SQLite in WAL mode. When you replace pethealth.db by hand, always delete the -wal and -shm files next to it first. Otherwise SQLite may try to apply leftover changes to the restored file.
Moving a single pet
Section titled “Moving a single pet”To move one pet (with all its files) to another account or another PetHealth server, use Export pet (ZIP) on its profile and Import on the other dashboard. See Reports & export.
Upgrading
Section titled “Upgrading”docker compose pulldocker compose up -d- Schema changes are applied automatically at startup (versioned migrations). You’ll see
🔄 Migración N aplicadain the logs when one runs. - Take a backup first, and read the release notes.
- Downgrading to an older image after a migration isn’t supported. Restore the backup you took before upgrading instead.