Restoring a backup
Local dumps are in /var/backups/reportlog, newest 14 kept. Off-site copies
are reportlog/<name>.dump.age in the bucket.
From an off-site copy, on the machine that holds the private key:
age -d -i reportlog-backup-key.txt -o restore.dump reportlog-2026-10-19T03-00-00Z.dump.age
then copy restore.dump to the server.
Into the server's database (replacing what is there):
sudo systemctl stop reportlog-api
sudo -u reportlog pg_restore --clean --if-exists --no-owner \
-d 'postgresql://reportlog@/reportlog?host=/var/run/postgresql' restore.dump
sudo systemctl start reportlog-api
sudo reportlog doctor
Into a new server: run install.sh after putting back the settings
file you copied off the first server, so it does not make a new contact key
(with a new key every restored address would be unreadable). Then restore as
above, and sudo reportlog deploy at a commit that includes every migration
in the dump.
An untested backup is a belief. Restore one somewhere that is not production now and then. The database tests do exactly this on every run: back up, restore into a fresh database and compare every report's hash.