💾 Back up before you update

A “low reported risk” verdict only means the release notes look quiet. A backup is what lets you undo a bad update. This is a short checklist you can run in an evening — including the step most people skip: testing the restore.

Use this before you bump a Docker tag, run apt upgrade on a homelab host, or click Update in a web UI. For a fuller off-site backup plan see our 3-2-1 restic guide. For image tags, see pin tags and back up volumes.

1. Know what to save

For most self-hosted apps, the pieces that matter are:

The container image is replaceable. The volume usually is not.

2. Keep Compose files in git

A pinned tag in docker-compose.yml is the update. Commit that file (and the rest of the stack, minus secrets) so you can see what changed and put the old tag back. Official Compose reference: services.

services:
  vaultwarden:
    image: vaultwarden/server:1.37.4
    volumes:
      - vaultwarden_data:/data

Updating then becomes a one-line diff. Paste a file into the Compose update checker if you want the current SafeToUpdate verdict for every tracked image.

3. Back up named Docker volumes

Docker’s volumes documentation shows the usual pattern: stop the service, start a throwaway container that mounts the volume, and tar it to the host.

docker compose stop vaultwarden
docker run --rm -v vaultwarden_data:/data -v "$PWD":/backup alpine \
  tar czf /backup/vaultwarden_data-$(date +%F).tgz -C /data .
docker compose start vaultwarden

Copy that archive off the machine — another disk, a NAS, or an object store — before you pull a new image. Bind mounts are simpler: rsync or tar the host directory, again with the app stopped if it is writing files.

4. Dump databases; don’t copy a live data directory

A file-level copy of a running Postgres or MySQL data dir is a common way to get a backup that will not restore. Use the database’s own tools, then back up the dump.

# Postgres, via the running container (adjust service and user names)
docker compose exec -T db pg_dump -U appuser appdb > appdb-$(date +%F).sql

# MySQL / MariaDB
docker compose exec -T db mysqldump -u appuser -p appdb > appdb-$(date +%F).sql

# SQLite: stop the app, then copy, or use the official backup command
docker compose stop app
docker compose exec -T app sqlite3 /data/app.db ".backup /data/app.db.bak"

Official references: pg_dump, mysqldump, and SQLite’s backup API / .backup.

5. Snapshots are for fast undo; backups leave the disk

Proxmox, ZFS, btrfs and TrueNAS all make snapshots cheap. That is a gift when an update goes wrong and you want to roll back in a minute. It is not a backup if the snapshot lives on the same disk you are about to upgrade, or the only disk in the machine.

If you prefer a file-level tool, Kopia and restic both do incremental, encrypted backups of directories and can store them on a NAS or object storage.

6. Test the restore (the step people skip)

A backup you have never restored is a hope. You do not need a perfect disaster-recovery drill. You need proof that yesterday’s archive opens.

  1. Named volume: create a throwaway Compose project, mount a copy of the archive into a new volume, start the app on a different host port, and log in. Confirm the library, vault or documents you expect are there.
  2. Database dump: start a fresh Postgres or MySQL container, load the dump, and run a couple of queries — row counts, a recent record, the admin user.
  3. PBS / vzdump: restore one guest or one archive to a spare VMID (not over the live one) and boot it. Official PBS restore docs start at the Proxmox Backup Server documentation.
  4. SQLite or config: open the file; does the app start against it?

Two traps show up over and over:

7. Then, and only then, update

  1. Read the official release notes and the verdict on the app’s SafeToUpdate page.
  2. Note the version you are on now.
  3. Pin the new tag (no :latest), update one app at a time, and watch the logs.
  4. Click through the features you actually use before you walk away.
  5. Keep the pre-update backup until the new version has been in use for a few days.

Related reading: a safe Docker update workflow, updating Immich safely, and notify, don’t auto-update.

Questions

Is a Proxmox or ZFS snapshot enough?

A snapshot on the same disk is a fast undo, not a backup. If that disk dies, the snapshot goes with it. Keep a copy somewhere else — another disk, a NAS, or Proxmox Backup Server — before you update anything you care about.

Can I copy a live Postgres or MySQL data directory?

Not safely. A copy taken while the database is writing can be unreadable. Stop the app or take a proper dump (`pg_dump`, `mysqldump`) and back up the dump. SQLite should be copied only after the app is stopped, or with the sqlite3 `.backup` command.

How do I know a backup is good?

Restore it once, on purpose, before you need it. Bring the dump or volume up in a throwaway Compose project or a spare container, start the app, and check that the data you care about is actually there.

How long should I keep the pre-update backup?

Until you have used the new version for a few days and you are sure you will not roll back. A backup taken after a bad migration will not help you go back. Backups from a newer app version often cannot be restored into an older one.

Want a project tracked, or a step this guide missed? Suggest it.

📬 The Weekend Patch Report

One email a week: what's safe to update, what will bite, and one practical tip for your homelab or printer.

Free, weekly, unsubscribe anytime.