cardinal

Backups

What to back up so a site can be restored.

Cardinal has no backup command yet. A site lives in three places, and a restore needs all three from the same point in time.

WhatWhereWhy
PostgresThe postgres volume, or your database serverEvery site's schema, one per site, plus the platform schema
S3 bucketCARDINAL_S3_BUCKETFile bytes, stored under <tenant id>/<sha256>
CARDINAL_MASTER_KEY.env, or .cardinal/secrets.exs in a dev workspaceUnseals each site's data key

The master key encrypts each site's data key, which in turn encrypts stored secrets such as SMTP passwords and bot tokens. Data restored without its key keeps working, but every stored secret is unreadable. Password hashes and API secrets still work.

Database dumps

Use pg_dump on the whole database, not one schema. A site's sealed data key and its tenant id live in the platform schema, and encrypted values are tied to that tenant id.

docker compose -f docker-compose.prod.yml exec postgres \
  pg_dump -U cardinal -Fc cardinal > cardinal-$(date +%F).dump

Files

Deleted Records' files stay in the bucket for at least 24 hours before the daily sweep removes them. A bucket with versioning gives you a longer window.

On this page