On-demand backup
Scheduled backups
Backups run automatically according to the schedules you configure. See capsule schedule for setup. The Capsule service must be running for scheduled backups to fire. Check with:Restore
There are several ways to restore, covered in detail below. Most people only ever need the first one — start here and only read further if your situation doesn’t match:From the TUI
- Download the encrypted backup from the cloud
- Verify the SHA-256 checksum
- Decrypt it locally using your server’s encryption key
- Pipe it into your database using the native restore tool (
psql,mysql,mongorestore)
From the dashboard
Open your dashboard, find the backup you want to restore, and click Restore. The dashboard sends a signal to the agent running on your server — the restore runs locally, never through Capsule’s servers. When to use: When you prefer a GUI, or when you want to trigger a restore on your server from a different machine.From a local file (capsule restore --file)
Restores a database directly from a local .sql.gz file (typically produced by capsule download). No cloud connection is required — the file is piped straight into the target database.
If you have only one connection configured:
--connection can be omitted. Capsule selects your one connection automatically — you’ll see Using connection: <label> printed before the confirmation prompt.
If you have more than one connection configured:
--connection <label> is now required. Capsule never guesses or falls back to “the first one” — omit it here and the command lists every connection you have and exits with an error instead of restoring, so nothing is overwritten by accident.
When to use:
- You used
capsule downloadto get a decrypted copy and want to restore it locally or on a different server - Cross-environment restore (production backup → staging database)
- Air-gapped or offline recovery where the cloud is not reachable
- You want to inspect the SQL before restoring (unzip the
.sql.gz, review, re-zip, then restore)
Download and decrypt a backup (capsule download)
.sql.gz file you can open, inspect, or restore anywhere.
When to use:
- You need a readable copy of your data outside of Capsule — importing into a local dev environment, sharing with a colleague, or loading into a data analysis tool
- You’re migrating to a different server and want to seed the new database from an existing backup
- You want to restore a backup on a machine that is not running the Capsule agent (e.g. a local laptop)
- You want to archive a specific snapshot to cold storage or an external system
The
.enc file you can download from the dashboard is encrypted and not directly usable. capsule download is the command that gives you the plain, readable .sql.gz.Migrating to a new server (decommissioning the old one)
Everything above assumes the server that originally took the backup is still alive and reachable. If you’re replacing that server entirely — the old one is being wiped, returned, or shut down for good — that assumption breaks, because the encryption key lives only on the server that generated it, not in Capsule’s cloud. Without it, on any machine, existing backups are permanently unreadable — Capsule itself cannot recover a lost key. This means server migration has an extra step that’s easy to miss, and has to happen before the old server is gone:-
On the old server, before decommissioning it: save the encryption key.
Copy the 64-character key it prints into a password manager or secrets vault. See
capsule keyfor the full explanation of why this matters and how to store it safely. -
On the new server: install Capsule as normal, then import the saved key instead of generating a new one.
This prompts for your license key, then for the saved encryption key (input hidden). Once it completes, the new server can decrypt every backup the old one ever took. Full walkthrough, including the exact prompts you’ll see:
capsule auth— disaster recovery. -
Now you can download and restore normally —
capsule download <backup-id>andcapsule restore --fileboth work on the new server exactly as they did on the old one, because it holds the same key.
Restore to a different host (source server still exists)
To copy a specific snapshot onto a different server or database instance, while the original server is still alive and reachable:- Run
capsule download <backup-id>on the server that has the encryption key - Copy the resulting
.sql.gzto the target server (viascp, a shared volume, etc.) - On the target server, run
capsule restore --file ./backup.sql.gz --connection <target>
How backups are stored
Plan retention periods — every backup gets an expiry date based on your plan at the time it was created; a background worker deletes it once that date passes:
If you upgrade or downgrade, existing backups’ expiry dates are recalculated against the new plan automatically — you don’t need to do anything for the new retention period to apply.
See also
capsule key— save your encryption key before decommissioning a server, and understand what happens if it’s lostcapsule auth— the full--restoreflow for importing a saved key onto a new server, with exact prompts and outputcapsule download— download and decrypt a specific backup by IDcapsule backup list— find a backup’s ID before downloading it