Portlyn now includes built-in backup/restore helper scripts for self-hosted operations.
scripts/backup.sh [output-dir]scripts/restore.sh <backup-file>
Both scripts read .env.docker automatically when present.
When DATABASE_DRIVER=postgres:
- backup uses
pg_dump - restore uses
psql
Required tools:
pg_dumppsql
When DATABASE_DRIVER=sqlite:
- backup copies
DATABASE_PATHto timestamped file - restore copies selected backup file back to
DATABASE_PATH
- Keep application version metadata with each backup.
- Keep database backups and
/dataartifacts in separate storage. - Test restore regularly in a disposable environment.
- Run backup before upgrades and retain at least one known-good restore point.