Integrate/Streamline Database Migration from sqlite3 (or other) to InfluxDb, mariadb, (etc.)

Severel forum entries try to tackle database migrations.
It’s great to start of with a simple database setup, but once HA is used more seriously it’s nice to keep the “old” data when moving to a more appropriate database such as InfluxDb, mariadb.

Examples of topics:

While the instructions may have been more or less valid and not heavily tested at one point in time, the database structure is regularly changing, and has changed quite a bit recently.

Therefore, my request is that migrations would be integated and updated along with HA updates and benefit from automated testing.

Would love to see this. My sqlite is 800MB+ now, where I would want to import it into an sql server instance.

My guess is that with the current “separation” of short-term and long-term data, it is the migration of Long-term statistics (energy etc) that is important to migrate?

So one could limit the scope of this request to:
- create new db and migrate long-term statistics
and let the short term (10days default in recorder?) re-create itself in the new database.

2 Likes