CorfedoCorfedoDocs

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 upWhy
The database, with your PostgreSQL service's backups, such as snapshots or point-in-time recoveryIt holds everything except the indexes, such as workspaces, members, conversations and the credentials saved in Settings
corfedo-keysThe credentials saved in Settings cannot be read without it
corfedo-oauthIt signs the tokens of the CLI, coding agents and SDKs. With a new key set, every client signs in again.
corfedo-databaseThe passwords of the six logins, which must match the restored server
values.yaml and the chart versionThey restore the same configuration
The .corfedo-root-id object under storage.s3.prefix, or the whole bucketSee 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.

  1. 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.

  2. 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, set database.host in the values file.

  3. In an empty namespace, create the Secrets from your copies under the same names, and the others as on Install. After helm uninstall the Secrets still exist: replace the contents of any that differ from your copies.

  4. Keep storage.s3 as before. If the bucket lost its objects, copy back your copy, or at least <prefix>/.corfedo-root-id.

  5. 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
  6. 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 logsWhyWhat to do
The storage marker of this installation (…) is missingThe bucket or prefix lost its .corfedo-root-id objectCopy 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 beforeUse the storage the message names

On this page