Technical reference

Database schemas

OpenClaw stores control-plane state in the shared state database and agent data in one SQLite database per agent. Schema migrations run forward when a database opens. Older OpenClaw builds refuse databases written by a newer schema.

Two mechanisms back that contract. CI runs scripts/check-native-state-schema-version.mjs, which fails the build when the Swift and TypeScript state-database contracts declare different schema versions. openclaw doctor --fix owns file-to-SQLite migrations and records a receipt for each one in the shared migration_runs and migration_sources tables.

This page is an index. The reference is documented on seven pages, one per reader job. Open the page that matches your task and stay there.

Page Read it when
Database layout The two database roles, their on-disk paths, and the tables behind individual features.
Versioning contract How schema versions are recorded, when a bump is required, and how updaters cross one.
Per-person and companion storage Personal GitHub connections, personal model accounts, and Apple companion delivery journals.
Storage changes and release preflight Preparing for another backend, the material-change review checkpoint, and openclaw database preflight.
Agent schema history Per-agent database schema versions, their changes, and their first releases.
State schema history Shared state database schema versions, their changes, and their first releases.
Integrity, troubleshooting, and recovery Integrity checks, common database errors, and the supported downgrade recovery path.
  • Backups — archives, per-database snapshots, scheduling, and offsite copies for the databases described here
  • Updating — updating safely, including the verified backup to take before a schema bump, and the rollback strategy
  • Doctor — the repair and migration tool that fixes stale config/state and reports health problems
  • openclaw doctor — CLI reference for the command that runs those migrations
  • openclaw update — CLI reference for the updater that preflights schema support

Where each section moved

Every section heading from the previous single-page version keeps its anchor here, so an existing link such as /reference/database-schemas#schema-bumps-and-older-updaters still resolves. Each entry points at the page that now holds the content.

Was this useful?
On this page

On this page