Where backups come from
Each asset has one source: the place its drills get the backup from. This page says what each kind needs from you and what DownDrill refuses.
Which sources an asset can use
| Asset | Upload | Bucket | Live |
|---|---|---|---|
| Containerized application | One recovery bundle | The newest recovery bundle | A running Compose project |
| WordPress site | One UpdraftPlus set | The newest complete set | None: the site is never contacted |
| PostgreSQL | One dump file | The newest dump | A dump through a read-only role |
| MySQL or MariaDB | One dump file | The newest dump | A dump through a read-only role |
An administrator chooses the source when adding the asset, and can change it with Reconnect the backup source under Asset settings. Saving a source starts a connection test, which reports what it found and restores nothing (Getting started).
Uploading a file
On the Connect step, choose Upload the files:
- an application: one
.tar.gzor.tgzrecovery bundle; - WordPress: every file of one UpdraftPlus set, or one
.zip,.tar,.tar.gzor.tgzarchive holding them; - PostgreSQL: one
pg_dumpcustom, tar or plain SQL dump, gzipped or not; - MySQL or MariaDB: one
.sqlor.sql.gzfile frommysqldump.
One upload may come to 2 GiB in all; a larger one is refused, so use a bucket instead. An upload goes straight into DownDrill’s vault, encrypted under a key of its own, and does not refresh itself: every drill restores the same bytes until you upload a newer backup.
An S3-compatible bucket
The bucket can be on Amazon S3 or another S3-compatible service. Give its endpoint (empty for Amazon S3), region, bucket and prefix, and a key that can list the bucket and read its objects and nothing more: on Amazon S3, s3:ListBucket and s3:GetObject. DownDrill only lists and reads; it changes nothing in your bucket.
Every drill that fetches from it looks under the whole prefix, deeper folders included, and takes:
| Asset | Which backup |
|---|---|
| Application | The most recently stored .tar.gz or .tgz file. |
| WordPress | The newest set, by the date in its file names, whose database, plugins, themes and uploads are complete. A newer, incomplete set is passed over and the evidence says why. If no file has a backup’s name, the set inside the most recently stored archive. |
| PostgreSQL, MySQL or MariaDB | The most recently stored object that is not empty, whatever its name. |
So give each asset a prefix of its own, ending in /, since backups/shop also takes in backups/shop-old/. A copy, from a bucket or taken live, may be up to 20 GiB, a WordPress set’s files counted together; a larger one fails the drill as resource_limit.
A live database
DownDrill can take a fresh dump of a PostgreSQL, MySQL or MariaDB database at each drill, from a connection string such as postgresql://downdrill_backup:<password>@db.example.com:5432/shop or mysql://downdrill_backup:<password>@db.example.com:3306/shop. If the password holds a character such as /, ?, # or %, percent-encode it. The host must have a public address that accepts connections from DownDrill’s runner. A relay that forwards only to that host and port carries the dump, and is removed before the restore starts.
PostgreSQL
Every statement, the dump included, runs in a read-only session. A superuser is refused, as is a role that can insert, update, delete or truncate in any table, which an application’s own role usually can. On PostgreSQL 14 and later:
CREATE ROLE downdrill_backup LOGIN PASSWORD '...';
GRANT pg_read_all_data TO downdrill_backup;
PostgreSQL 13 has no pg_read_all_data, so grant the same schema by schema:
CREATE ROLE downdrill_backup LOGIN PASSWORD '...';
GRANT USAGE ON SCHEMA public TO downdrill_backup;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO downdrill_backup;
GRANT SELECT ON ALL SEQUENCES IN SCHEMA public TO downdrill_backup;
These cover what exists now: a table made later needs the same grant, or the dump fails. To dump a table with row-level security, the role needs BYPASSRLS, which DownDrill accepts.
MySQL and MariaDB
Before dumping, DownDrill reads the role’s SHOW GRANTS in a read-only session. It needs SELECT and SHOW VIEW, granted directly on the whole database or on everything:
CREATE USER 'downdrill_backup'@'%' IDENTIFIED BY '...';
GRANT SELECT, SHOW VIEW ON `shop`.* TO 'downdrill_backup'@'%';
Apart from USAGE, which grants nothing, any other privilege is refused, ALL and EVENT included, as are WITH GRANT OPTION, a role granted to the user, and any grant DownDrill cannot read. The dump is of that one database, made with mysqldump (mariadb-dump for MariaDB) and --single-transaction. It asks for the routines and triggers the role can see, which with these privileges may not be all of them, and never for events.
A running Compose project
A Compose application can be captured while it runs. This needs a DownDrill runner on the project’s own Docker host, with the project on that runner’s list of projects it may capture. The list is set on the runner by whoever operates it, not in the dashboard, and is empty unless set; a project not on it is refused, as unsupported_format, before anything is read.
Enter the project’s com.docker.compose.project label and, for an HTTP check, the service to check. Each exposed TCP port gets a TCP check.
The runner reads the project from Docker’s record of its containers, and never runs anything in them, stops them or restarts them. Each named volume is mounted read-only into a disposable container that archives it. The environment, which often holds passwords, goes into the encrypted copy for the restore and is kept out of logs and evidence. A bind mount or other mount that is not a Docker volume, or a service with more than one container, is refused rather than captured in part.
Private registries
For an application whose images are in a private registry, give the registry’s address and a username and password that can only pull: one registry per asset. The username and password are sealed, used to pull images and nothing else, and never put into the restored containers or the evidence. An image that cannot be pulled fails the drill as unsupported_format, naming the image.
How credentials are kept
- Database passwords, bucket keys and registry logins are sealed with AES-256-GCM before they are stored, bound to their organisation and asset. Host names, ports, database and user names, endpoints, buckets, prefixes and registry addresses are plain settings, recorded in a drill’s evidence and shown to anyone with its verification link.
- Sealed credentials are opened only for a runner that has claimed a job needing them, a connection test or a drill, and to remove them from the progress lines, logs and evidence it sends back. The runner does not keep them.
- A drill of a copy DownDrill already holds, from an upload or with Test this copy, gets no source credentials, only a registry’s.
- To change one, reconnect the source and enter its credentials again.
Addresses that are refused
A database host, and a bucket endpoint you give, must resolve only to public internet addresses. A private, loopback, link-local or other address that is not public stops the connection test or drill before it connects, as wrong_credentials. This is so that a source cannot be pointed at DownDrill’s own network or a cloud provider’s metadata service (Isolation and security). A database with no public address cannot be dumped live: upload its dumps, or put them in a bucket DownDrill can reach.