If you have a recent backup, this path is faster than installing from scratch.
sudo apt update
sudo apt install -y openjdk-21-jdk-headless \
postgresql-16 postgresql-16-pgvector \
s3fs gzip tar
sudo mkdir -p /mnt/backups
echo "<bucket>:<KEY>:<SECRET>" | sudo tee /etc/passwd-s3fs
sudo chmod 600 /etc/passwd-s3fs
sudo s3fs <bucket> /mnt/backups -o passwd_file=/etc/passwd-s3fs \
-o allow_other -o use_path_request_style
sudo tar -xzf /mnt/backups/files-YYYY-MM-DD.tar.gz -C /tmp \
var/lib/ownsona-backup/apt-mark-manual.txt
xargs -a /tmp/var/lib/ownsona-backup/apt-mark-manual.txt sudo apt install -y
sudo tar -xzpf /mnt/backups/files-YYYY-MM-DD.tar.gz -C /
This restores /home, /root, /etc, /usr/local, /opt, the per-user crontabs in /var/spool/cron, the live systemd units, and the metadata bundle.
zcat /mnt/backups/database-YYYY-MM-DD.gz | sudo -u postgres psql -X postgres
sudo systemctl daemon-reload sudo systemctl enable --now ownsona.service sudo systemctl enable --now ownsona-backup.timer
The OS-level ownsona Linux user is restored along with
/home/ownsona, so no manual adduser is needed.
PostgreSQL roles (including the ownsona role and its password
hash) are restored by pg_dumpall.