Every PostgreSQL backup proven by restoring it
A base backup that has never been restored is a hope, and a WAL archive that stopped last week is a hole found
on the day it is needed. DBA Brain, an open-source DBA tool, takes base backups - full
or incremental -, keeps the WAL archive honest, holds a proven copy away from the database host, and restores the
whole cluster on a schedule onto a target you name - started, checked with pg_amcheck, and recorded
file by file.
Six checks between a base backup and a restore you can trust
Checked against its manifest
pg_basebackup writes a backup_manifest with a checksum of every file, and pg_verifybackup checks the backup against it. A backup the server's version cannot check is reported as not verified, never as passed.
Hashed at the source
SHA-256 and size in bytes of every file - each part of a base backup, each WAL segment - taken on the database host and stored in a catalog on another host. The first hash can never be changed, not even by a direct UPDATE.
A WAL archive that is watched
Every run forces a WAL switch, so the segment being written is archived instead of waiting to fill, and fails when archive_command is failing. Only WAL that no kept base backup needs is removed.
Copied off the host
To a Linux repository over SSH, in the same pass, compared by checksum and bytes - and, if you choose, encrypted there with age, so the repository cannot read what it holds.
Restored on a schedule
The whole cluster, onto the target the entry names, to the latest WAL or a point in time it covers. An incremental chain is combined with pg_combinebackup, and a drill whose WAL has a gap is refused - recovery would stop there and open on an older state.
Started and checked
A restore counts only when the cluster starts, answers a real query and pg_amcheck --heapallindexed passes over every table and index (on unless the entry sets checkdb off). amcheck goes on the drill's target, never the source.
From the base backup to the proof, one message per step
Each step is said as it happens - in Telegram for the steps the entry's notify sends there, and
in the run's record - so a failure names the step it stopped at, and why.
- Back upa base backup, full or incremental, on the primary, with its manifest
- Archive WALa switch every run, a failing archiver turned into an alert
- Copyto the repository, proven by checksum and bytes
- Restorethe chain combined, WAL replayed to the latest or the moment asked
- Checkstart the cluster, answer a query, run
pg_amcheck - Recordevery file applied, in order, on the backup and server pages
A backup that matches its manifest is not yet a cluster that starts
pg_verifybackup checks that a base backup still matches the checksums in its manifest. It starts
nothing: it cannot show that the WAL archive reaches the moment you will need, that recovery replays to it, or
that the data inside is consistent. A restore that starts, replays and passes pg_amcheck can - which
is why DBA Brain runs both, and keeps the record of each.
Install, get a key, describe the backup and the restore
Backup and restore need a free dbabrain key - an email sign-in, 14 days, renewed with one command (what a key is).
pip install "dbabrain[postgres,ssh]" dbabrain init dbabrain key-request
Then a backup entry, a WAL entry and a restore entry, each field stated: the backup and restore reference, and everything else DBA Brain does.
Questions asked first
Does it install anything on the PostgreSQL server?
No agent and no extension on the source. DBA Brain runs on a machine of its own and reaches the database host over SSH, where it runs PostgreSQL's own pg_basebackup - inside the cluster's container or on the host itself. The WAL archive is PostgreSQL's own archive_command; a standby is refused, so the chain is always the primary's.
Can it restore to a point in time?
Yes, wherever the archived WAL covers the moment: the drill restores the newest base backup chain before it and replays WAL to it with recovery_target_time. The files it applied are recorded in order.
Which PostgreSQL versions?
A base backup is compressed on the server from PostgreSQL 15 (a plain directory before it), an incremental needs PostgreSQL 17 with summarize_wal on, pg_verifybackup reads a compressed backup from PostgreSQL 18, and pg_amcheck needs PostgreSQL 14. A check the version cannot run is reported as not run, never as passed.
What about SQL Server and Oracle?
The same loop: FULL, DIFF and LOG with RESTORE VERIFYONLY and DBCC CHECKDB on SQL Server (SQL Server backup verification), RMAN with RMAN VALIDATE on Oracle (Oracle RMAN backup validation). Backups for MySQL are not in this version.
Can someone set it up for us?
Yes - setting up DBA Brain on your servers, and backup and restore work in general, are among the DBA work we do: see what we do.