What to back up
cymph_log-data (nginx logs) is worth keeping if you retain logs for compliance reasons. cymph_embedding-data holds only a cached model and is re-downloaded automatically — skip it.
Choosing a method
Volume snapshots are the recommended approach. One mechanism captures the database and the application data together at the same point in time, and restore is a straight extraction — no schema migration, no dump-format compatibility to think about between versions. The trade-off is that copying a live PostgreSQL data directory is not crash-consistent, so the stack has to be stopped while the archive is taken. In practice this fits the maintenance window you already take for upgrades.If you need backups without downtime, use
pg_dump against the db container for the database and snapshot cymph_api-data separately. That gives you a hot backup but two restore paths to manage instead of one.Taking a backup
- Stop the stack from the directory containing
compose.yaml:
- Archive each volume through a throwaway container:
- Copy the configuration files:
- Start the stack again:
- Move the
backupdirectory off the host, to wherever you keep encrypted backups. It contains the deployment’s secrets in plaintext, so treat it accordingly.
Restoring
Restore onto a host with the same Cymph release the backup was taken from. Restoring into a newer release is not supported — restore first, then upgrade.- Extract the release bundle and put the saved configuration files back in place. Do not run
env.sh— it would generate new secrets and make the backup undecryptable.
- Make sure nothing is running, and remove the volumes that the restore will replace:
- Recreate the volumes and extract the archives, preserving ownership so PostgreSQL can read its data directory:
-
Confirm the TLS certificate and key are present at the paths recorded in
.env— those are host paths and are not part of the volume backup. See TLS certificates. - Start the stack:
- Verify the restore.
docker compose psshould show every service healthy, and you should be able to log in with the credentials that were in use when the backup was taken — user accounts and passwords come from the restored database, not from setup.
db service fails its healthcheck after a restore, check its logs first — a permissions problem on the data directory is the usual cause, and it means step 3 ran without -p or without root:

