Surfaces
A surface is one thing you back up: a database, a file tree or a mailbox. Each Fire Drill tests one surface. Every surface goes through the same steps. The data is streamed, compressed with zstandard, encrypted to your age public key and written to locked storage. Only the first step (how the data is read) and the last (how a drill checks it) change from one kind of surface to the next.
The stream is encrypted on the host that read it, so no plaintext crosses a third-party network. It is not written to disk either, with one exception. A SQLite surface is first copied to a temporary file on the same host, readable only by its owner (SQLite). The file is deleted as soon as it is uploaded.
The surfaces
| Surface | What is captured | The host needs |
|---|---|---|
| PostgreSQL | Schema from pg_dump, rows over binary COPY, one snapshot | pg_dump at least as new as the server |
| MySQL and MariaDB | mysqldump --single-transaction | The MySQL client |
| MongoDB | mongodump --archive | The MongoDB Database Tools |
| SQLite | One committed state, through VACUUM INTO | Nothing |
| Files | A directory tree, incremental: each run uploads only what changed | Read access to the tree |
| Every message of an IMAP mailbox, as RFC 5322 | The mailbox's password or app password | |
| WordPress | The site's database and files in one snapshot, from a plugin. Each backup uploads what changed. | The SafeGrd Backup plugin. No host to set up. |
| Laravel | The app's database, .env and storage/app in one snapshot. Each backup uploads what changed. | The CLI on the app's host, reading its .env |
If you need something that is not in the table, such as Microsoft 365 mail, MSSQL, Redis, ClickHouse, Elasticsearch, Windows hosts or Kubernetes volumes, request a surface.
What a Fire Drill proves, per surface
Every Fire Drill downloads the snapshot from your bucket and decrypts it with your key. What it checks after that depends on the surface.
| Surface | What the drill checks |
|---|---|
| PostgreSQL | The table count and every table's row count match the
manifest, each table's binary COPY stream is readable, and the extensions are present.
By default the drill runs in memory, with no database running anywhere. That checks the
data but never runs the schema. To prove the schema loads, run a sandbox drill: with
--sandbox-target, the snapshot is restored into a scratch database you name and
counted there. The daemon does the same for a surface with drill.sandbox_url.
On a plan with sandbox drills, a surface without one restores into a throwaway cluster that
the daemon starts from the host's PostgreSQL server (Daemon). |
| MySQL and MariaDB | The dump ends with its completion line. Every table the
manifest names is in it, with exactly the recorded number of rows. In memory, that checks
the data. A sandbox drill (--sandbox-target mysql://… or
drill.sandbox_url) loads the dump into an empty database, counts every table,
and empties the sandbox again. |
| MongoDB | Every collection and view in the archive reached its end. Each
collection's documents match the checksum mongodump wrote and the count in the
manifest. A sandbox drill restores into an empty database with mongorestore,
counts every collection, and drops them again. |
| SQLite | A real restore on every drill. The database file is written out and
opened by the SQLite engine. It has to pass PRAGMA integrity_check, and every
table's row count has to match the manifest. The file is deleted afterwards. |
| Files | The whole snapshot is restored into a scratch directory, and every file
has to match its SHA-256. The digest recomputed from the restored files has to match the one
recorded at backup time. A --format tar archive is checked in memory against
the manifest sealed inside it. |
| The message count matches the manifest, every message parses as RFC 5322 mail, and every message's SHA-256 matches. Nothing is written to disk. | |
| Laravel | The database passes its engine's drill and every file matches its
SHA-256. The .env in the snapshot holds an APP_KEY that Laravel's
cipher accepts, and the dumped migrations table agrees with the migration
files. |
A drill does not replace a rehearsed restore, which shows that a person can get the data back. A drill shows that every snapshot reads back whole, without anyone having to remember to check.
Running several surfaces on one host
To back up more than one thing from a host, list the surfaces in the config file. The daemon runs each on its schedule.
Each entry registers as its own node and counts as one surface against your plan quota.
Keep each id stable, because state, locks and snapshot history are keyed on it.
A config with no surfaces: list still loads as one implicit Postgres surface, so
an existing install needs no edit. The full shape is in Daemon.
Adding a surface to a host that is already running
The host's config is the one list of what it backs up, so you add a new surface there. You can do it from the console or by hand.
In the console, click Add surface on the host's row under
Nodes, and give the surface's name, its schedule and where its credential
comes from. Nothing changes on the host until you run safegrd claim there:
safegrd claim adds the surfaces named for that host to its config. It only adds.
A surface the config already has is left as it is, and the previous file is kept as
config.yaml.bak. Running it again adds nothing. If SafeGrd holds the credential,
you type it once in the console and it is never written to the file.
By hand, add an entry under surfaces:, as above.
Either way, a running daemon reads the changed config at the start of its next pass and backs
up the new surfaces then. To start one straight away, click Back up now on the
surface's row. With no daemon running, safegrd daemon run --once takes the first
backups.