How backups are set up
A backup source is a saved database connection plus a schedule, a retention rule and a storage location. Create one under Backups. The connection can reach a private database through an SSH connection. Which plan includes how many backed-up databases and how much storage is on the pricing page.
- Schedule: a cron expression, in UTC.
0 2 * * *is every day at 02:00. Leave it empty to back up only when you start one. - Keep backups for (days) and Always keep the last (backups): both optional. After each backup, a successful backup is deleted if it is older than the number of days, or if there are more successful backups than the count (the oldest go first). The count is therefore the number of newest successful backups kept. If an object cannot be deleted, its record is kept and the delete is tried again at the next backup.
- Each backup is streamed to storage with its SHA-256 recorded. Plain SQL, Redis and MongoDB backups are gzipped on the way; a Postgres custom dump is not gzipped again.
- A backup can be deleted by hand from its source page, unless it is running or being read by a restore. Deleting a source deletes the backups it stored; the confirmation says how many backups and how much storage go.
What each database supports
| Postgres | Redis | MongoDB | |
|---|---|---|---|
| How a backup is made | pg_dump in custom format for one database; pg_dumpall (plain SQL, gzip) for a whole server. Roles are stored beside a custom dump. | A logical dump: every key of every database that holds keys, read with SCAN and DUMP, written as gzip-compressed JSON lines with each key's time to live. | mongodump, as a gzip archive, for one database or for the whole server. |
| Restore | pg_restore with --clean --if-exists --single-transaction for a custom dump; a plain dump is applied as SQL. Practice run available. | RESTORE ... REPLACE for each key. Keys with the same name are replaced; other keys stay. Practice run available. | mongorestore. Collections with the same names are replaced; users and roles are not restored. Practice run available. |
| Refused on purpose | Restoring onto the source connection unless Replace the original database is chosen explicitly. | Redis Cluster (backup and restore), a read-only replica as destination, a destination older than the backup. | Sharded clusters (backups and restores are not offered). Restoring onto the source unless Replace the original database is chosen. |
| Is the stored file checked? | Yes. The whole file is read and its SHA-256 compared with the recorded one before anything is written. | A practice run reads and counts the whole file without writing. | Yes. SHA-256 is checked before anything is written, and again while the restore reads the file. Document counts are compared afterwards. |
| Point-in-time recovery | Yes, continuous. See below. | No. | Yes, for a replica set whose connection user has the backup or root role. See below. |
Postgres
- A single-database source is dumped with
pg_dump -Fc(a custom archive) unless the source's own pg_dump arguments choose a format. A whole-server source is dumped withpg_dumpallas gzip SQL. - A custom dump also stores the server's roles in a separate file, without password hashes. A restore applies them only when Restore users and permissions first is on, which it is not by default. Without it the restore runs with
--no-owner --no-privileges. Applying roles needs psql 10 or newer and is refused otherwise. - Before any SQL runs, the whole stored file is read, its SHA-256 is compared with the recorded one and the archive is read through. A mismatch or a damaged archive stops the restore with nothing written. A backup taken before checksums were recorded still restores, and the log says it could not be verified.
- Restoring onto a server older than PostgreSQL 17 removes the
SET transaction_timeout = 0;statement that newer tools write. - A source can be given a test server for restore tests, an SSH connection to a server with Docker, where a weekly restore test runs. Possibug records when a restore was last proven; a source with no test server has never had its restore proven.
Redis
- The backup needs no
redis-clion the database host and works through an SSH connection. Keys are read in pages of 500 while Redis keeps running. Keys that have already expired are left out. - A restore replaces keys of the same name and leaves other keys alone. It refuses before writing anything if the destination is a read-only replica, is Redis Cluster, or runs an older Redis version than the backup came from.
- Redis Cluster cannot be backed up.
MongoDB
MongoDB is available to organizations it has been switched on for. Possibug connects to a MongoDB you already run; it does not create or change your MongoDB servers.
- Versions: MongoDB 5.0 to 8.0 get every feature the connection user's rights allow; older versions get the health check only. Only 8.0 has been tested so far. 5.0, 6.0 and 7.0 follow the same rules but have not been run against Possibug yet. Hosted MongoDB services have not been tested either.
- Topologies: a single server and a replica set are supported. A sharded cluster gets the health check and insights only; backups and restores are not offered.
- Rights: when you test a connection, Possibug reads the server version, the topology and the connection user's roles, and lists in plain sentences anything the user cannot do. A backup of the whole server needs the
rootorbackuprole onadmin. A restore needsroot,restore,atlasAdminorreadWriteAnyDatabaseonadmin, orreadWriteordbOwneron the connection's own database. - Where mongodump runs: on the database host over SSH when the tools are installed there, inside the MongoDB Docker container when they are not, and otherwise in Possibug through the tunnel. Without SSH it runs in Possibug directly against the server, reading from a secondary when the connection names a replica set and one is healthy. The password is passed in a temporary file, never on a command line.
Each backup records how consistent it is, and the source page says it in a sentence:
| Level | Meaning |
|---|---|
| oplog | Only for a whole-server backup of a replica set. The archive includes the change log, which is what allows an exact restore. Possibug's own restore does not replay that change log. |
| best-effort | Every other backup: one database, or a standalone server. Collections are copied one after another, so writes made during the backup may be partly included. It is not an exact snapshot of one moment. |
- A backup fails if mongodump exits with an error, and fails if it dumped no collections (for example a mistyped database name).
- A restore can go into a different database name. A whole-server archive is restored without the
admin.system.*collections, so the destination keeps its own users. A restore that fails part-way leaves the collections it had already restored. - After a restore, Possibug counts the documents of each restored collection and compares them with the counts recorded at backup time. If every count matches it says so; otherwise the restore finishes with a warning and lists each collection with the expected and found counts. Views are named, not counted. Collections over 1,000,000 documents are counted by estimate, and the result says so. Each count is limited to 30 seconds and the whole check to 2 minutes.
- Exact restores: Possibug's restore does not replay an
oplogarchive's change log. To do that yourself, fetch the archive from a bucket you own (see Storage below) and run the command below against a server you can afford to overwrite. On a destination that already has users, a whole-server--oplogReplayreplaces them and can leave you unable to sign in.
mongorestore --gzip --archive=<file>.archive.gz --oplogReplayRestoring
- A restore needs a destination connection. By default it cannot be the connection the backup was taken from; restoring onto the source needs the Replace the original database switch.
- A practice run reads the stored file to prove it is complete, and checks the destination, without writing. For MongoDB it does not check document contents.
- A backup whose source no longer exists is listed under Backups from removed sources on the Backups page, read-only, with Restore and Delete.
Storage
By default, backups are stored in Possibug's backup bucket, under a prefix that belongs to your organization. A source can instead keep its backups in your own S3-compatible bucket, such as a DigitalOcean Space. Possibug writes to it with no object ACL, so objects keep the bucket's private default, and the endpoint must be https. The access keys are not stored on the source; they are read from Possibug's side, so setting this up needs us to add them: write to support. Restores and retention always use the bucket a backup was actually written to, so changing a source's storage never orphans older backups.
Point-in-time recovery
Point-in-time recovery (PITR) keeps a continuous record of changes in addition to periodic base copies, so you can restore to a moment between backups. Which plan includes it, and the length of the window, is on the pricing page.
Postgres
- Possibug captures write-ahead log (WAL) continuously over the replication protocol with
pg_receivewal, and takes base backups. Protecting a database does not need a Postgres restart whenwal_levelis replica or higher andmax_wal_sendersis above 0, which are the defaults. It does need a role withREPLICATION, apg_hbaline for it (a reload, not a restart) and a physical replication slot, so that Postgres keeps WAL until it is captured. - A restore does not overwrite the running database. It rebuilds a separate copy at the time you choose: a base copy is placed in a fresh directory and WAL is replayed up to that time, then the copy is promoted. You can send it to a new server, which for a Docker source is a Docker host running the same image and for a native source is native Postgres. A native new server is refused before it is created if the source uses musl, or if Possibug cannot tell what the source runs, because text sorts differently between musl and glibc.
- Possibug watches the delay in capturing WAL and the free disk space on the database host, and raises an alert when either is at risk. It records the earliest and latest time you can restore to.
- A restored copy is started once with no network and checked before the restore is reported as good.
- Old WAL is deleted only when no kept base backup needs it. If any kept base lacks the information needed, or the remaining WAL would have a gap, nothing is deleted.
- With a test server set (an SSH connection to a server with Docker, never the database host), the newest recovery point is restored once a week with no network, checked with a query, timed, and removed. It does not start if the test server has less than 2.5 times the base's size free. A database with no test server is never tested.
MongoDB
- Turning on point-in-time restore for a source keeps a continuous copy of the replica set's change log (the oplog), captured about every 60 seconds, in the source's storage. A restore takes the newest whole-server backup from before the time you choose and replays the captured changes up to it.
- It needs a replica set, and a connection whose user has the
backuporrootrole. The page tells you which of these is missing. Only changes that a majority of the replica set has confirmed are captured. - Only a whole-server backup can be the base for a restore. A per-database backup cannot.
- If the oplog rolls over before Possibug reads it, or a failover rolls back an entry it had captured, the chain is marked broken with a reason and capture pauses until the next base backup starts a new one.
- A restore goes to a different server from the source. The destination should be empty or disposable, because a restore does not delete collections that the base does not contain. Prepared (two-phase) transactions and time-series buckets are skipped, and the log counts them.
Redis
Redis has no point-in-time recovery. Its backups restore to the state when the backup ran.