Skip to main content
r5d.chat state spans a database, two secrets, and one volume per user. They must be treated as a single recovery set, because restoring one without the others produces a broken installation.

The recovery set

required
Users, sessions, conversations, messages, encrypted provider and MCP configuration, workspace records, branding, and audit history.
required
Decrypts provider API keys, custom headers, MCP headers, OIDC client secrets, and workspace identity tokens. Without it, those rows are unreadable ciphertext.
required
Signs sessions. Restoring without it forces every user to sign in again, which is survivable but disruptive.
Each user’s home directory. Not recoverable from the database.
The GHCR pull secret and any AWR_* values needed to bring the installation back up.
A database backup on its own is not sufficient. Restoring it with a different SETTINGS_ENCRYPTION_KEY leaves every user’s provider configuration permanently unusable, and they must re-enter their credentials.

Back up the database

For the bundled PostgreSQL, take a logical dump:
Verify the dump is non-trivial and readable before trusting it:
For an external managed database, use the provider’s snapshot mechanism and its documented restore procedure.

Back up the secrets

Export the Secret and store it in a secrets manager, not in Git:
This file contains base64-encoded plaintext credentials. It is as sensitive as the database itself. Encrypt it at rest.

Back up workspace volumes

Use your CSI driver’s snapshot support. With a VolumeSnapshotClass available:
Snapshots of a live ReadWriteOnce volume are crash-consistent. For a consistent point-in-time copy, scale the workspace to zero first. Alternatively, copy files out of a running workspace:

Restore

1

Prepare an empty namespace

Restore into a clean namespace rather than on top of a damaged one, so you can compare before cutting over.
2

Restore the original secrets first

The encryption key must be in place before the application reads any encrypted row.
3

Restore the database

Install the chart so the database exists, then load the dump:
4

Restore workspace volumes

Recreate each PVC from its snapshot using the same name as the original. Names are derived from the user ID hash, so a renamed PVC will not be found.
5

Deploy the matching application version

Use the chart version that matches the backup. A newer version may expect a schema the restored database does not have; run the upgrade afterwards so migrations apply in order.

Validate the restore

Do not declare success on a green rollout alone.
Sign in with a local account and, if configured, through SSO.
Open Settings → Providers. Providers should list correctly and Test connection should succeed. Failure here means the encryption key does not match the database.
Open an older conversation and confirm messages and tool results render.
Start a workspace and browse the home directory. Files should match the snapshot. Recoll indexes can be rebuilt from the files if search is stale.
Run a task that writes a file and returns a download link, end to end.

Retention and deletion

helm uninstall is not a data purge. It removes chart-managed compute and routing, while these persist:
  • The bundled database’s StatefulSet PVC
  • Every workspace PVC, which carries keep semantics
  • Database rows, encrypted credentials, and conversations if the database is external
Before uninstalling, take an inventory and a final backup:
Deleting a namespace destroys everything still namespaced in it, including retained PVCs. Never use namespace deletion as a shortcut, and never as an accidental purge.
Test your restore procedure on a schedule. An untested backup is a hypothesis.