Post

Home Assistant Recorder Recovery: SQLite WAL on Local Storage, PostgreSQL for New State

Home Assistant Recorder Recovery: SQLite WAL on Local Storage, PostgreSQL for New State

I documented the recovery evidence for the Home Assistant recorder after a pinned-image rehearsal. The key finding: SQLite WAL mode requires shared memory on a local filesystem, so the portable QNAP layout keeps /config on a retained local claim while pointing new recorder state at an external PostgreSQL database—without migrating the existing SQLite history, which Home Assistant explicitly does not support.

Why the Recorder Stays on a Local Claim

The pinned Home Assistant image uses SQLite with WAL enabled. WAL needs shared-memory files that only work on a local filesystem, not over NFS. The documented layout therefore pins the /config claim to zimaboard-0 local storage, where the rehearsal successfully restored the current configuration and reopened the existing SQLite history. That claim is the only path that satisfies the recorder’s runtime requirement.

PostgreSQL Is for New Events Only

A separate synthetic rehearsal wrote new recorder events to PostgreSQL 14.23, confirming the external database path works for fresh state. Home Assistant’s documentation is clear: migrating existing recorder history between SQLite and PostgreSQL is unsupported. The architecture note now records that the verified SQLite archive must be preserved when evaluating a backend change, so the historical data remains queryable even if new events land in PostgreSQL.

Platform Transfer

This mirrors the same discipline used for the media-postgres-qnap staging: isolate the recovery source, rehearse on a parallel target, and gate cutover on verified behavior. A platform team running stateful add-ons on Kubernetes can apply the same split—local claim for engine-specific runtime files (WAL, shared memory, sockets), external database for durable queryable state, and a documented migration boundary that prevents an unsupported history conversion from becoming an incident.

This post is licensed under CC BY 4.0 by the author.