Back up and restore
What to back up from a Kubernetes installation of Corfedo, what happens when the database is older than the bucket, and how to restore the installation.
Corfedo keeps its state in your PostgreSQL database and its indexes in the bucket. The volumes of the search nodes and indexers hold caches and need no backup.
What to back up
| Back up | Why |
|---|---|
| The database, with your PostgreSQL service's backups, such as snapshots or point-in-time recovery | It holds everything except the indexes, such as workspaces, members, conversations and the credentials saved in Settings |
corfedo-keys | The credentials saved in Settings cannot be read without it |
corfedo-oauth | It signs the tokens of the CLI, coding agents and SDKs. With a new key set, every client signs in again. |
corfedo-database | The passwords of the six logins, which must match the restored server |
values.yaml and the chart version | They restore the same configuration |
The .corfedo-root-id object under storage.s3.prefix, or the whole bucket | See The bucket |
With Secrets of your own, back up those. You can create the others again as Install describes.
The backups hold the installation's keys. Store them as you store secrets.
The bundled PostgreSQL and Keycloak have no backup.
The bucket
Restore the database and the bucket as a pair: the same bucket and prefix, at the same S3 endpoint (an AWS_ENDPOINT_URL_S3 override counts), with the .corfedo-root-id object under the prefix. Without a copy of the indexes, every indexed repository shows Unavailable after a restore until you select Reindex now on its page, see Repositories.
To reindex less, copy the bucket's objects right after each database backup, for example with rclone copy, and keep one copy for each database backup you keep. A repository whose index changed between the backup and the copy still shows Unavailable until you reindex it.
When the database is older than the bucket
When you restore the database to an earlier point than the bucket's contents:
- Indexes built after that point are deleted from the bucket about an hour after the restore.
- A repository that got a new index after that point can show Unavailable, because its earlier index was deleted. Reindex now indexes it again.
Restore an installation
Restore into a namespace without the release. To restore over an existing release, run helm uninstall first. It keeps the Secrets, the database and the bucket.
-
On a new cluster, provide what Prepare the cluster lists: cert-manager, the issuer for workload certificates, the storage class your values name and the public entry.
-
Restore the database and its six logins to your PostgreSQL server, with the passwords in your copy of
corfedo-database. If the server's address changed, setdatabase.hostin the values file. -
In an empty namespace, create the Secrets from your copies under the same names, and the others as on Install. After
helm uninstallthe Secrets still exist: replace the contents of any that differ from your copies. -
Keep
storage.s3as before. If the bucket lost its objects, copy back your copy, or at least<prefix>/.corfedo-root-id. -
Install the chart version you kept with your values file:
helm install corfedo oci://ghcr.io/corfedo/charts/corfedo --version CHART_VERSION \ --namespace corfedo --values values.yaml -
On a new cluster, point the host name's DNS at its public entry.
Check: as in Check the result, the setup Job completes and every pod is ready. Members sign in as before.
| What you see in the setup pod's logs | Why | What to do |
|---|---|---|
The storage marker of this installation (…) is missing | The bucket or prefix lost its .corfedo-root-id object | Copy it back from your backup, or start anew with a new database and an empty bucket |
The installation's storage identity … belongs to S3 bucket … | The bucket, prefix or endpoint differs from before | Use the storage the message names |
Related
- Upgrade and operate lists what
helm uninstallkeeps. - Data handling lists what is stored where.
Upgrade and operate
Run operator commands, change values, upgrade to a new version, add or remove a search node and uninstall a Corfedo release that the Helm chart installed.
Installation settings
Settings an operator changes for the whole installation, on a single host and on Kubernetes, such as how long the audit log is kept and the storage budget.