rai db
SQLite personal database diagnostics and backup. These commands operate on the local RaiSE database at ~/.rai/raise.db (canonical) and the per-project replica at .raise/rai/raise.db.
Do not modify
.raise/**/*.dbfiles directly. Always use the CLI to prevent data loss or schema corruption.
rai db check¶
Run integrity checks on the local SQLite database. Reports any corruption, schema drift, or version mismatches.
rai db status¶
Show database status — path, size, schema version, last migration, and record counts.
rai db consolidate¶
Merge the per-project replica into the global canonical database at ~/.rai/raise.db. Use after switching machines or worktrees.
rai db import-legacy¶
Import legacy JSONL/YAML personal data into SQLite (one-time). Scans legacy file locations and imports sessions, journal entries, signals, patterns, and pipeline runs. Original files are renamed to .migrated — never deleted. Idempotent: already-migrated sources are skipped.
rai db migrate¶
Deprecated
Use rai db import-legacy instead.
Alias for rai db import-legacy. The name "migrate" was misleading because schema migrations (DDL) happen automatically on every DB open — this command only imports legacy flat-file data.
rai db export¶
Export database contents to a portable format (JSON or SQL dump).
rai db import¶
Import a previously exported backup into the local database.
See also: rai doctor, rai session