# Upgrade and troubleshoot

Source: https://usecns.dev/engram-topic-upgrade-and-troubleshoot/

[Start here](https://usecns.dev/manual-engram/)
[CLI commands](https://usecns.dev/commands-engram/)
[Configuration & integration](https://usecns.dev/engram-topics/)

1. Confirm executable version, chosen OTE and database. Preserve a consistent authorized backup, accounting for SQLite WAL consistency rather than copying a live database file blindly, and test upgrades on a copy.
2. Validate OTE, including public-key anchor paths. Fix unknown fields, missing remote endpoints/models and invalid glob templates before investigating retrieval quality.
3. For pre-oracle-split stores, run `engram migrate --oracle-split`, review `would_demote`, then deliberately run with `--apply`. The first pass backfills per-oracle state and grandfathers existing graduations; it is not a no-write preview. Legacy guards retain special pre-tool-use support until migration.
4. For old ring IDs, temporarily mount them with `engram default-ote --legacy-rings`, or review and run `engram migrate --rings`. The latter moves active legacy canon/team nodes to current IDs with evidence and retirement lineage; it is idempotent, not a string replacement in SQLite.
5. Run `engram doctor`, inspect `engram status` for blocked graduation, unverified imports and revoked-key evidence, then `engram probe` for source drift. Investigate the source and guidance before `probe --reanchor`; rebinding a hash does not validate advice. Backfill embeddings only when outbound retrieval is authorized.
6. Test one synthetic recall, outcome, sleep and fact round-trip in isolation before re-enabling hooks or synchronization. Keep network errors and `not_checked` visible rather than declaring success from fallback.

For episodic material, `distill` requires at least two active episodic source IDs and creates a generalized procedure/invariant with derived lineage and sublinear evidence pooling. Correlated observations do not become independent evidence. `ingest-transcript` separately mines gate-failure/resolution episodes from selected JSONL after stripping injected envelopes; inspect input authorization first, because stripping is not privacy sanitization.