Skip to main content
HydroGo
DeploymentBackups and restore

Backups and restore

Back up the database and media, verify them, and practise a restore before you need one.

A backup you have never restored is a hope, not a backup. Schedule backups, copy them off the machine and rehearse the restore on a scratch copy.

Back up

BASH
# SQLite database plus media directory
hydro backup sqlite --destination backups/ --media-dir data/media --config config.yaml

# PostgreSQL
hydro backup postgres --destination backups/ --config config.yaml

Run it from cron or a systemd timer:

hydrogo-backup.timer
# /etc/systemd/system/hydrogo-backup.timer
[Timer]
OnCalendar=*-*-* 03:15:00
Persistent=true
[Install]
WantedBy=timers.target
BASH
# keep the 14 newest, preview first
hydro backup prune --root backups/ --keep 14 --dry-run
hydro backup prune --root backups/ --keep 14 --confirm

For MySQL or MariaDB use your own mysqldump. For PostgreSQL you can also use pg_dump directly.

Scheduled cloud backups

With S3 configured you can enable scheduled backups inside HydroGo (backup.enabled, prefix, retention_days, hour_utc). The admin's Telemetry > Backups tab lists and verifies signed backups; sign them with HYDRO_BACKUP_SIGNING_SEED.

Verify and restore

BASH
hydro restore verify --snapshot backups/hydro-2026-04-01.snapshot

# unpack an archive into a NEW directory
hydro restore unpack --archive backups/site.tar.gz --destination restore/ --public-key HEX
Restores are deliberately guarded. hydro restore stage and hydro restore postgres require explicit flags confirming that sessions were revoked, egress is quarantined and old writes are blocked, so a restore cannot silently replay old sessions or double-write.

Portable export

hydro portable export writes the content of your site to a portable document, and hydro portable import --dry-run validates it before --confirm replaces content. Use it to move between databases or environments.

BASH
hydro portable export --path export.json --config config.yaml
hydro portable import --path export.json --dry-run --config config.yaml