Skip to content

Backups

Tandem keeps things that cannot be rebuilt: everyone's reading and listening positions, the sync maps that each took hours of transcription, your pairing decisions, the user accounts, and the sign-ins for any import sources. The server backs all of that up every night on its own. This page covers what a backup holds, where to manage them, and how to restore one, and it asks you to try a restore once before you need it.

What a backup holds

Part In the backup?
The database: positions, bookmarks, sync maps, pairs, users, settings, import-source sign-ins (encrypted) Yes, a full dump every night
Cover images Yes, a snapshot alongside each dump
Your ebook and audiobook files No. They are your own folders; keep them on storage that has its own redundancy
The secrets/ folder next to docker-compose.yml No, on purpose. Copy these into a password manager yourself (below)

A dump holds data, not media, but sync maps add up: a library of a couple of thousand transcribed books can produce dumps of several hundred megabytes, growing as more books are transcribed. Cover snapshots share unchanged files with the night before, so two weeks of them cost about one copy of your covers plus whatever changed. With the default retention of 14 daily and 6 monthly backups, budget for about 20 dumps.

Before you start

  • The server writes backups to whatever you mounted at /backups in docker-compose.yml. Put that on a different disk from the server, ideally a NAS. A backup on the disk that just died is no backup at all.
  • Cover snapshots rely on hardlinks to stay small, so the backup location needs a filesystem that supports them. A local ext4 or XFS disk does; most SMB/CIFS mounts do not. If you can only offer an SMB share, check the server log after the second night for [backup] errors.

Save your secrets once

Three values live in the secrets/ folder and nowhere in the backup: credential_enc_keys, jwt_secret_key and postgres_password. Copy all three into a password manager now.

The one that matters most is credential_enc_keys. The import-source sign-ins in the database are encrypted with it, so a backup restored without the matching keys cannot use them. You would have to connect Audible and Adobe again, and every fresh Adobe authorization uses up one of a limited number of device slots.

Leaving the keys out of the backup is deliberate: an archive that carried the encrypted sign-ins and the key that unlocks them would not be encrypted in any useful sense.

Manage backups

Open System → Backups (admins see this section; it is collapsed by default).

The top line says where backups are written and when the last one succeeded. If no backup has succeeded in the last 36 hours, or there are none at all, an Overdue badge appears next to it. That is the one thing worth glancing at now and then.

The schedule and how long to keep things are edited right there and take effect without a restart:

Setting Default What it does
Nightly backups On Turns the scheduled backup on or off
Hour (UTC) 3 The hour of the nightly run, in UTC, not your local time
Keep daily 14 How many recent nightly backups to keep
Keep monthly 6 How many first-of-the-month backups to keep beyond those

A brand new server takes one backup straight away, so there is something to restore before the first night.

The superadmin also gets:

  • Create backup, with an optional label such as before the big reorganise. Manual backups are never pruned; they stay until you delete them. Take one before every upgrade.
  • Download on each row, which saves the database dump to your computer, for a copy that lives somewhere else entirely.
  • Delete on each row.
  • Restore, below.

Restore a backup

Restoring replaces the live database and covers with the backup's, and the app is briefly unavailable while it runs. Anything that changed since that backup is lost, including positions synced in the meantime.

  1. Open System → Backups as the superadmin.
  2. Click Restore on the backup you want, type RESTORE, and click Confirm restore.
  3. When it reports back, reload the app.

If the web app itself is not working, you can restore from the host instead. The commands are in Backup & Restore on GitHub. Do not run the database migrations against a restored database afterwards: the dump already carries the schema it was taken with.

Starting over on a new machine. Install the same version of Tandem the backup came from, with the same /backups mount and the three secrets from your password manager. Sign in as the new superadmin; the old backups are listed under System → Backups. Restore the latest one, then restart the server (docker compose restart server) and sign in with your old account. The restart matters if the new install is a newer version than the backup: the server brings the restored database up to date as it starts, and it only does that at start-up.

Try a restore once

A backup you have never restored is a hope, not a backup. Once, on a quiet evening, restore one into a scratch copy of the stack: a copy of docker-compose.yml with different ports and volume names, pointed at a secrets/ folder with the same values. Then check:

  • [ ] You can sign in.
  • [ ] Reading and listening positions are where you left them.
  • [ ] Covers show up.
  • [ ] Import sources still say Connected. This is the test that proves your saved credential_enc_keys are the right ones.

The exact commands for a scratch stack are in the test-restore drill.

Why it is like this

The server runs its own backups. There is no separate backup container to set up or forget about: the schedule, pruning and restore all live in the server, so a working install is a backed-up install.

Manual backups are kept forever. The one you took before an upgrade is the one you want when the upgrade goes wrong, and it should not quietly age out while you are deciding.

Restoring needs a typed confirmation and the superadmin. It overwrites everyone's positions, not just yours.

Go deeper