Database backups
to S3

Back up PostgreSQL, MySQL and Redis to any S3-compatible bucket, by hand or on a schedule that keeps the last few. Restore into the same app or a new one, from the bucket or a file, with a safety backup first and a checksum check on the way in.

curl -fsSL https://get.echowa.dev/install.sh | sudo bash

Backups

On the database's own page, not in a crontab

Each PostgreSQL, MySQL and Redis app has a Backups section: when the last one ran, when the next one will, how many are kept, and every backup with a Restore button.

Every backup, and when the next one runs

Back up now, or add a schedule in your time zone that keeps the last 7. Backups by hand, and the ones taken before a restore, stay until you delete them.

What a backup does

Dumps with the database's own tools, a manifest beside each one, and checks before anything is overwritten.

  • Any S3-compatible bucket

    AWS S3, Cloudflare R2, Backblaze B2, Wasabi, Hetzner or your own. Add one in Settings, and Test writes, reads, lists and deletes a small object, naming the step that fails.

  • Schedules that prune

    A schedule in your time zone and how many successes to keep, 7 by default. After each success it deletes its oldest past that number.

  • Checked on the way back

    Each dump has a manifest with its size and SHA-256. A restore checks the dump against it as it reads, and stops before the end if they differ.

  • A safety backup first

    By default a restore backs up the current data before it starts, so you can go back. A backup never restores into an older server.

  • Into a new app

    Restore into a new app on the same major version or newer, which is also how you move to a new PostgreSQL. A PostgreSQL 17 backup restores into 18. Redis needs the same minor version or newer.

  • Export, and restore from a file

    Download a database, or a Redis snapshot, straight to your browser, with nothing kept on the server or in S3, and upload such a file to restore it.

  • Told when one fails

    A failed or skipped scheduled backup shows on the app's overview, and alerts can send it, or say when there's been no success for over a day.

What's in a backup

The app's database, the one its connection URL names, dumped with the database's own tool: pg_dump in its custom format for PostgreSQL, and mysqldump with --single-transaction, gzipped, for MySQL. Both read a consistent copy while the database runs. Other databases you made by hand in the same server aren't included.

For Redis it's the snapshot a replica would get, from redis-cli --rdb: the whole server, every logical database in it, with keys' expiry times. It's stored as .rdb, not gzipped, so a download loads in Redis as it is.

Each backup is two objects in the bucket: <folder>/<app>/<app>-<time>-<id>.dump (.sql.gz for MySQL, .rdb for Redis) and a .json manifest beside it with the app, template, server version, size and SHA-256. Echowa needs nothing else to find them again. After losing a server, install Echowa on a new one, add a location with the same bucket and folder, and choose New app, From a backup.

Restoring

Restore from a backup's menu in the history, or from Restore from the bucket, which lists every backup in the location's folder for the app, including ones another server made. You type the app's name to confirm, and the app's deploys wait until the restore ends.

  • PostgreSQL restores all or nothing.
  • MySQL restores one table at a time and stops at the first error, which is when the safety backup matters.
  • Redis replaces every key, in every logical database, so keys written since the backup are gone. The snapshot is checked with redis-check-rdb before anything changes, so a damaged file changes nothing, but a reload that fails after the check can leave the server empty. Clients see errors while it loads.
  • Into a new app creates the app on the tag you choose, waits for it to be running, then restores into it.

A Redis app deployed by a release before 1.0 needs one redeploy before its first restore. The restore dialog says so before it changes anything, and backups work without it.

Export and restore from a file

Export downloads the database to your browser as it's dumped: PostgreSQL's custom format, for pg_restore or pgAdmin, or plain SQL, gzipped SQL for MySQL, and an RDB snapshot for Redis. Deploys of the app wait until the download ends, so for a big database on a slow connection, back up to S3 and download that instead.

Restore from a file takes a file Export or a backup's download made and restores it with the same checks as a restore from the bucket. It needs the file's size plus 1 GiB free beside Echowa's database, and the upload is deleted when the restore ends.

Setting up the bucket

  • A key for this bucket only, allowed to put, get, delete and list objects and to abort multipart uploads. On R2, an API token with Object Read & Write on the one bucket. Echowa stores it encrypted and never shows it again.
  • Server-side encryption from your provider. Echowa doesn't encrypt backups itself, so anyone with the bucket's keys can read them.
  • A lifecycle rule that aborts incomplete multipart uploads after a day.
  • No default retention from Object Lock. With one, AWS wants a checksum on every upload that Echowa doesn't send, and every backup fails.

The install guide has the exact permissions, and what versioning does to a schedule's deletes.

What it doesn't back up

The volumes of your own apps, whose data is only on the server's disk. Echowa's own database is backed up before every update, and daily if you install with --with-backups, to /var/backups/echowa on the server. Copy that folder off the server yourself.

Questions

What backups cover, and what's still on you.

Which databases does Echowa back up?

PostgreSQL and MySQL apps made from Echowa's templates, each the one database its connection URL names, and Redis apps, as a snapshot of the whole server. Your own apps' volumes aren't backed up by Echowa.

Which storage providers work?

Any S3-compatible one: AWS S3, Cloudflare R2, Backblaze B2, Wasabi, Hetzner or a server of your own. Turn on path-style addressing for a provider that needs it, which most self-hosted ones do.

Are backups encrypted?

Not by Echowa. Use your provider's server-side encryption, and a key that reaches this one bucket only. The key itself is stored encrypted with your APP_KEY.

Does a backup stop my app?

No. pg_dump and mysqldump with --single-transaction read a consistent copy while the database runs. A Redis backup forks the server, as its own append-only rewrites do, so a Redis close to its memory limit while taking many writes can run out, and each one takes at least 5 seconds. Deploys of the database wait until a backup or restore ends.

Can I restore onto a newer version?

Yes. Into a new app takes a tag of the same major version or newer, so a PostgreSQL 17 backup restores into PostgreSQL 18. Redis needs the same minor version or newer, since its snapshot format changes in minor releases. A backup never restores into an older server.

What if the server is gone?

Install Echowa on a new server, add a storage location with the same bucket and folder, then choose New app, From a backup. Each backup carries its own manifest, so nothing else is needed.

Deploy it.
Then see everything.

One server, every deploy, every number.

curl -fsSL https://get.echowa.dev/install.sh | sudo bash