Skip to Content
LogiStackDocs
Data

Back up a database or volume

Create a backup policy that dumps a database or archives a volume to S3, SFTP or another destination on a cron, with retention, encryption and verifies.

A backup policy copies one thing from a service to a backup destination on a schedule: a dump of the database, or an archive of one volume. It deletes old copies by your retention rules, can encrypt every backup before it leaves the server, and can test the newest backup on its own schedule. Set one up on every service whose data you can't rebuild, before you go to production.

Before you start

What a policy backs up

TargetWhat is writtenFile
PostgreSQL databasepg_dump in custom format, compressed.dump
MySQL databasemysqldump --single-transaction, all databases.sql
MariaDB databasemariadb-dump --single-transaction, all databases.sql
MongoDB databasemongodump --archive.archive
Redis databasean RDB snapshot.rdb
libSQL databasean SQL dump from sqld.sql
A volumethe volume's files as a compressed tar.tar.zst

A dump is small and restores anywhere. A volume archive is a byte-for-byte copy of the files. Each policy covers one target; add a second policy for a volume, or for another volume.

Backups are written to <bucket>/<prefix>/backups/<policy-id>/<timestamp>-<run-id>.<ext>, with .age added when encryption is on. For example:

acme-backups/logistack/backups/bkp_7f3a/2026-11-06T03-00-00-000Z-bkr_91c2.dump.age

Create a backup policy

Open the Backups tab

Open the service and select Backups. On a service without backups, select Set up backups. Otherwise select Add policy.

Choose what to back up

In What to back up, pick the database (marked Recommended) or one of the volumes. Select Continue.

The new backup policy wizard for a PostgreSQL service

Choose where it goes

In Where it goes, pick a destination. If there is none, select Add a destination; the wizard keeps your answers, so come back when it's saved.

Set the schedule

In When it runs, set when it runs, and the Time zone. Use the Simple editor (Minutes, Hourly, Daily, Weekly, Monthly) or switch to Cron and type an expression. The default is 0 3 * * *, every day at 03:00. The Next 5 runs preview shows when it fires in the chosen zone.

Set retention

In How long to keep them, fill in Keep the newest (default 14) backups, Delete after a number of days, or both. Retention runs after every backup.

Test restores (databases)

In Test restores, keep Verify on a schedule on and set when it runs. The default is 0 5 * * 0, Sundays at 05:00. A verify restores the newest backup into a throwaway container and runs a sanity query; the live database is never touched.

Choose consistency (volumes)

For a volume, Consistency offers Stop <service> while archiving. The service is scaled to zero for the copy, then back. Turn it on when the service writes to the volume all the time, such as SQLite or a file-based queue.

Choose encryption

In Encryption, keep Encrypt before upload on. Each backup is encrypted with age on the server, so the bucket only ever holds ciphertext.

Review and start

Check the summary and select Start backing up. With encryption on, the next page is Save the backup key. Select Download key file or copy the key, store it outside the server (a password manager works), then select I've saved the key.

The backup key is shown once. LogiStack keeps a sealed copy to restore, but if the server is lost, the key is the only way to read your backups. Lose both and the backups are gone. Encryption can't be turned off later.

How retention works

A backup is kept if either rule keeps it. With Keep the newest 14 and Delete after 30 days, the policy keeps the 14 newest backups plus any backup up to 30 days old. With only a count, it keeps exactly that many. Deleted backups show Pruned by retention in the run history and can't be restored.

Some providers bill deleted objects for a minimum period (Wasabi bills 90 days), so short retention there costs the same as the minimum.

Read the Backups tab

The Backups tab of a PostgreSQL service, with a database dump policy, a volume policy and the recent runs

Each policy under Policies shows:

  • Its title, such as Database dump (pg_dump) or Volume /var/lib/postgresql/data, the schedule in words, the time zone and the destination.
  • Next run, Retention, Verify (databases) or While archiving (volumes), and Last run.
  • Encrypted with age with a Decrypt without LogiStack section, or Stored unencrypted in the bucket with an Encrypt backups link.

Recent runs lists backups, verifies and restores, newest first, with their Status, Size, how long they Took and the SHA-256 checksum of the file. A running backup shows its phase and bytes so far. Finished backups that retention still keeps have a Restore button. See Restore a backup.

Run a backup now

Select Run now on a policy. The run appears under Recent runs and writes to the policy's destination. Select Verify now on a database policy to test the newest backup right away.

Pause, resume or delete a policy

  • Use the switch on a policy to pause it. Next run then shows Paused. Turn it back on to resume.
  • Select the trash icon to delete a policy. The policy and its run history are removed. Backups already in the bucket stay there and can be restored by hand.

Turn on encryption later

On an unencrypted policy, select Encrypt backups, then Encrypt and show the key. Backups from then on are encrypted; earlier ones stay as they are and still restore. Save the key as described above.

If you turned encryption on but didn't save the key, and no encrypted backup exists yet, select Generate a new key under Encrypted with age. The old key stops working. Once an encrypted backup exists, the key can't be replaced or removed.

Decrypt a backup without LogiStack

Under Encrypted with age, open Decrypt without LogiStack. It shows a ready command for the newest backup, built from the destination's bucket, prefix and endpoint:

Decrypt the newest backup
aws s3 cp "s3://acme-backups/logistack/backups/bkp_7f3a/2026-11-06T03-00-00-000Z-bkr_91c2.dump.age" - \
  --endpoint-url https://7c2f9e0a41b84d0f.r2.cloudflarestorage.com \
  | age -d -i backup-key.txt > "2026-11-06T03-00-00-000Z-bkr_91c2.dump"

Save the key as backup-key.txt, and run the command with the age CLI and the AWS CLI. For a destination that isn't S3, copy the .age file off it first (with scp, the share or the Drive web page); the command is then age -d -i backup-key.txt < <file>.age > <file>. See Restore a backup for the rest.

Alerts

Failed backups and failed verifies are sent to the channels whose rules include them. See Alerts and notifications.

Troubleshooting

  • No backup destination yet in the wizard: add one first under Backup destinations (S3 or other kinds).
  • A run fails with an access error: the destination's keys lost a permission. Backups need put, get, delete and list on the bucket. Run the destination's test again.
  • A volume backup of a busy service restores with half-written files: turn on Stop <service> while archiving, or back up the database with a dump instead.
  • A backup you want is missing: check the run's status for Pruned by retention, and raise Keep the newest.

On this page