Repository navigation
Releases: alexdelprete/ha-db-universal-migrator
Release list
v1.0.4
1.0.4 — pre-flight now checks both the source and the target engine against the minimum versions Home Assistant supports (SQLite 3.40.1, MariaDB 10.3, MySQL 8.0, PostgreSQL 12). A target below the minimum aborts before anything is written — HA would refuse to start on it. A source below the minimum warns and continues.
No other functional change from 1.0.3.
Migrate the Home Assistant recorder database between SQLite, MariaDB, MySQL and PostgreSQL — any direction, full history preserved. Target schema generated at run time from the installed HA models; source detected from configuration.yaml; per-table auto-sized batches; row-count verification. Tested end-to-end on four engine pairs with value-level comparison; first production run MariaDB 11.8 → PostgreSQL 18.6, 31.8M rows, 6.9 minutes.
v1.0.3
Migrate the Home Assistant recorder database between SQLite, MariaDB, MySQL and PostgreSQL — any direction, full history preserved.
1.0.3 — renamed the project and script to ha-db-universal-migrator. No functional change from 1.0.2.
Highlights
- Target schema generated at run time from the installed Home Assistant models (
Base.metadata.create_all) — no DDL shipped, no HA version pinned; the source'sschema_versionmust match the installedSCHEMA_VERSIONor nothing is written. - Source detected from
configuration.yamlwith HA's own YAML loader (!secret,!include, packages). - Per-table column diff before the copy; legacy leftover columns skipped, dangerous mismatches abort.
COPYfor PostgreSQL targets, batched multi-row inserts elsewhere; indexes and foreign keys dropped for the load and rebuilt afterwards; batch sizes auto-sized per table from row width, process memory limit andmax_allowed_packet.- Row-count verification per table at the end;
--dry-runexecutes the full pre-flight and writes nothing.
Tested
SQLite→PostgreSQL, PostgreSQL→SQLite, SQLite→MariaDB and MariaDB→PostgreSQL end-to-end against real servers with value-level comparison of every table. First production run: MariaDB 11.8 → PostgreSQL 18.6, HA 2026.9.2, schema 53, 31.8M rows, 13/13 tables matched, 6.9 minutes.