K
KernoDocs
Docs/Backup & data

Backup & data

Where state lives, how to dump it, and how to restore.

Where data lives

Two named volumes hold all state:

  • postgres_data — Postgres data files. Contains:
    • encrypted DB config store (LLM key, Google OAuth, connector tokens, licence key)
    • pg-boss job queue + schedule history
    • memory_chunks table — pgvector semantic memory
    • reactions / conversation metadata
  • kerno_data — mounted at /app/memory. Contains:
    • memory/.encryption-key (0600) — the bootstrap secret that decrypts everything in the DB config store
    • daily markdown context files
    • conversation history JSON
    • soul.md — auto-learnt preferences
    • ops metrics + token usage stats

Critical: back up both volumes. Restoring just Postgres without memory/.encryption-key means the encrypted config store is unreadable — you'd have to re-run the wizard.

Backing it up

# Postgres dump (config, conversations, vector memory, job queue)
docker compose exec -T postgres pg_dump -U kerno kerno > kerno-db.sql

# Memory volume tarball (encryption key, daily markdown, ops metrics)
docker run --rm \
  -v kerno_kerno_data:/data \
  -v $(pwd):/backup \
  alpine tar czf /backup/kerno-memory.tar.gz -C /data .

Restoring

# Restore Postgres
cat kerno-db.sql | docker compose exec -T postgres psql -U kerno -d kerno

# Restore memory volume
docker run --rm \
  -v kerno_kerno_data:/data \
  -v $(pwd):/backup \
  alpine tar xzf /backup/kerno-memory.tar.gz -C /data