Hosted backups and drills
If your database runs on Supabase, Neon or RDS and you have no server beside it, SafeGrd can back it up for you. If a surface has no host to drill it, for example one you back up from a GitHub Actions workflow, SafeGrd can drill it too.
For each job, SafeGrd starts a machine, gives it the one secret that job needs, and destroys the machine when the job ends.
Backup
- Your database read with a read-only role
- A machine for this backup dumps, compresses, encrypts
- Hosted storage locked under Object Lock
- Given
- the connection string, for this backup only
- Never given
- the key that decrypts backups
Fire Drill
- Hosted storage the newest snapshot
- A machine for this drill restores into a throwaway database
- A signed record every table counted
- Given
- the key, for the one snapshot it restores
- Never given
- the connection string
Back up a database with nothing to install
- Under Surfaces, choose Add surface, then Back up on SafeGrd.
- Name it, and pick what it is: PostgreSQL, MySQL or MariaDB, MongoDB, or a bucket.
- Paste the connection string. Test connection opens it from SafeGrd's server and says what failed when it cannot.
- Pick how often to back up and how long to keep each backup, then Add and back up now.
The first backup starts within a few minutes. If the password is wrong, you find out then instead of the next morning. The first drill runs on your plan's schedule.
The database has to accept connections from the internet. A read-only role is enough. If your database only accepts listed IP addresses, the console shows SafeGrd's addresses beside Back up on SafeGrd (when SafeGrd's machines connect from fixed ones).
Supabase
Click Sign in to Supabase and pick your project from the list. The session pooler's address is filled in for you. From then on, each backup signs in through Supabase with a read-only role whose password expires within minutes. You can type the project's database password instead, if you have it (Supabase does not show it again).
To skip the sign-in, copy the Session pooler string (port 5432) from Connect in
Supabase's dashboard and add ?sslmode=require. The transaction pooler on port
6543 cannot take a backup.
A project's Storage files are a second surface. You can add them two ways:
- With the sign-in: tick Also back up its Storage files beside Sign in to Supabase, where the console offers it. You type no S3 key. For each backup, SafeGrd reads the project's keys through the sign-in and hands them only to the machine it starts for that backup. They are never stored, and each use shows in the key access log.
- By hand: add a bucket surface with the project's S3 endpoint and an S3 key from Storage, Settings. Use this if the project has its legacy JWT keys turned off, because Supabase's S3 endpoint accepts those keys as the temporary key. The console tells you when this applies.
Each bucket is backed up as one archive of its objects and drilled on its own
(details). Both surfaces appear together
under Supabase project in the surfaces list, each with its own Fire Drills and
certificate. To restore, bring back the database rows first, then run
safegrd restore --target s3://* with the project's S3 key. Each file goes back
to the bucket it came from.
Each backup uploads what changed
A PostgreSQL backup reads every table and uploads only the rows that changed since the last one.
What it costs at your provider
Every backup reads the whole database, and your provider may bill that as egress. Before you
add the surface, click Price this schedule in the form. It measures the
database and prices the schedule at its provider. From a terminal,
safegrd estimate does the same.
Drill a surface on SafeGrd
Turn on Drill on SafeGrd in a surface's panel. Each time a drill is due, SafeGrd starts a machine, restores the newest snapshot, checks it the same way a host would, signs the record and destroys the machine. The Fire Drills tab marks these drills as run on SafeGrd. Surfaces that SafeGrd backs up are drilled this way from the start.
The surface's backups have to be in hosted storage, with a SafeGrd-managed key, because the machine needs to decrypt the snapshot. If the option is missing, the surface's panel tells you why.
PostgreSQL, MySQL, MariaDB, MongoDB and SQLite snapshots are restored into a throwaway database of the same engine. Files and mailboxes are read back in memory. If a PostgreSQL snapshot needs an extension the plain image does not have, such as pgvector or a Supabase extension, the drill runs on Supabase's own image, which has them.
Drill checks you wrote as queries run on SafeGrd's machine too. Checks written as commands run only on your own host.
A run on SafeGrd outside the schedule
On a surface's Details, Back up now on SafeGrd and Drill now on SafeGrd
start a machine straight away, even for a surface a host normally runs. Use them when the host
is down, or when an audit is coming and the plan's next drill is days away. Agents can do the
same with the MCP tools request_backup and request_drill and
on: safegrd.
What you need
The host needs a SafeGrd-managed key. A drill also needs the newest backup to be in hosted storage. A backup needs SafeGrd to hold the surface's connection string (Credential on the surface) and the project to use hosted storage. The backup is sealed to the host's key, so the host can restore it. If something is missing, the button says what.
What it costs
Each plan includes a number of these runs per rolling 30 days (see the table below). Backups and drills share the count across the whole organization.
- A drill that the plan's schedule already allows is free. A drill before it is due costs one run.
- A backup on SafeGrd of a surface that a host runs always costs one run.
- Every run also counts its machine minutes, like any other job.
Once you have used them all, the button tells you when the oldest run drops out of the 30 days.
What it records
A drill started this way is a normal Fire Drill. It is signed into the record and shown on the certificate, and the next scheduled drill is due one interval after it. A backup appears under the same surface as the host's own backups. On an incremental surface, that run uploads the whole database, because the machine does not have the host's cached state.
Which machine gets which secret
Each machine gets only the secrets its job needs, for that one surface, and only while the job runs.
| Job | Given | Never given |
|---|---|---|
| Backup | The connection string or bucket key, and the public key it encrypts to. | The key that decrypts backups. |
| Fire Drill | The key for the snapshot it restores. | The connection string. |
SafeGrd writes each release to the Key access record before it happens, with the job and the time. You can read it under Projects, Storage. For what SafeGrd can hold and the two ways your key can be managed, see Security and key custody.
Minutes on SafeGrd
Each plan includes machine time per rolling 30 days, and a size limit for snapshots drilled in a sandbox:
| Plan | Runs on SafeGrd | Largest snapshot | At once | On-demand runs | Surfaces SafeGrd backs up |
|---|---|---|---|---|---|
| Free | 20 minutes a month | In memory, within the plan’s storage | 1 | None | None |
| Starter | 800 minutes a month | 5 GB | 1 | 10 runs a month | 3 |
| Growth | 2,500 minutes a month | 8 GB | 2 | 30 runs a month | 10 |
| Scale | 8,000 minutes a month | 25 GB | 4 | 100 runs a month | 30 |
A job counts the time its machine ran, from when SafeGrd asked for the machine until the job ended. If the job moved a lot of data, it counts 10 minutes per GB instead, whichever is more. For example, a drill of a 2 GB snapshot that runs for 6 minutes counts 20 minutes. A backup of a 300 MB database that runs for 3 minutes counts 3. Fractions of a minute count, and there is no minimum.
- While a job runs, the console counts it at the most it can use: 10 minutes per GB of its snapshot. A first backup has no known size yet, so it counts as the largest snapshot your plan drills. When the job ends, the total drops to what it used.
- A stalled job is stopped at its deadline: 5 minutes, plus 5 per GB of the snapshot.
- Once you use up the plan's minutes, the next run waits until enough of the 30 days has rolled off. The console shows when.
- A snapshot over the sandbox limit is refused before anything is downloaded. Drill it on
one of your own hosts with
drill.sandbox_urlinstead. - Drills on your own hosts are never counted.