Backup and restore

Back up PostgreSQL, the configuration and the key ring, and restore them on Compose or Kubernetes.

Only PostgreSQL and the configuration need backups. Mirrors, vectors and summaries are rebuilt from your GitHub and Azure DevOps sources after a restore.

What to back up

Item Why
The PostgreSQL database Connections, scope, users, roles, the audit log, the license, curation, the encrypted secrets
The key-ring certificate and its password, or access to the Key Vault key Without it the stored secrets (GitHub App keys, model keys, users' upstream tokens) cannot be decrypted
synaxis config export Every setting except secret values, as a readable file
Your deployment files .env, compose.override.yaml and config/ (Compose), or your values files (Helm)

Note: A database backup holds your organization's proprietary code and project data. Store it encrypted, with the same care as the volumes. Keep the key ring apart from the database backups.

Docker Compose

To back up

docker compose exec -T postgres pg_dump -Fc -U synaxis synaxis > synaxis-$(date +%F).dump
synaxis config export -o codewright-synaxis-$(date +%F).yaml

Copy the secrets/ folder (with keyring.pfx and keyring_password) to your vault.

To restore

  1. Put back secrets/, .env, compose.override.yaml and config/.

  2. Start PostgreSQL and Qdrant only:

    docker compose up -d postgres qdrant
    
  3. Restore the database:

    docker compose exec -T postgres pg_restore --clean --if-exists --no-owner -U synaxis -d synaxis < synaxis-2026-10-01.dump
    
  4. Start the rest: docker compose up -d (with your profiles).

Kubernetes

To back up

  • Use your managed database's own backups (with point-in-time restore), or run pg_dump -Fc from a Job that reaches database.external.
  • Keep synaxis config export, your values files, and the secrets they name: the key-ring certificate (keyRing.certificate.existingSecret) or access to keyRing.keyVaultKeyId.

To restore

  1. Scale the API and the workers to 0:

    kubectl -n synaxis scale deployment,statefulset -l 'app.kubernetes.io/instance=synaxis,app.kubernetes.io/component in (api,worker)' --replicas=0
    
  2. Restore the database: a new server from the managed backup, or pg_restore --clean --if-exists --no-owner into an empty database.

  3. Point database.external at it, if it moved.

  4. Run helm upgrade with your values. The migrate hook brings the schema up to date, and the API and workers come back at their configured replicas.

What happens after a restore

At start, each worker finds the repositories in scope that have an indexed ref but nothing in the serving vector collection. It forgets what was indexed of them and queues a fetch, so their mirrors are cloned again and every ref is indexed from nothing. This is audited as index.recovered. Until Qdrant answers, the check retries every minute.

Tip: Re-indexing embeds everything again, against the embedding budget. Check the budget before a large restore, so the work is not held halfway.

If local projects are enrolled into managed workflows, move the change feeds' epoch once the server is back. The restore took the feeds back to the backup, so the positions desktop clients have read may now be given to other changes. Moving the epoch makes every client read its feed again from the start and reconcile it with what it holds:

synaxis workflows enrollments epoch
synaxis workflows enrollments epoch --move --expected epoch-1 --reason "Restored from the 2026-10-01 backup"

Name the epoch the first command shows. Until it moves, a client that read past the restored feed is refused with a conflict, so it applies nothing it cannot place. See Enrolled local projects.

See also