Migration from mysql to influxdb

Am running mysql ( actually MariaDB ) on my Synology NAS. I just installed the influxdb and grafana docker on another NAS.

I would like to preserve the data I have in mysql. I know there is a migration script but think that is built for the sqlite database.

How do I load all the mysql data into influxdb ?

You can’t load the data to influxdb AFAIK. InfluxDB is not an alternative to MySQL, it’s an additional database you can use in parallel with your primary DB. The recorder component requires an SQL database.

A solution is to disable the recorder component and push everything to InfluxDB, but then the history and the logbook components won’t work and you won’t see any graphs in the HASS UI.

2 Likes

I did not know this - thanks for the explanation.

A list of supported databases for the recorder component can be found at:

http://docs.sqlalchemy.org/en/latest/dialects/

@Sam,

Just in case you’ll be interested: I’ve been wondering the same, as Grafana is really slow with MySQL and I have 35GB of historical data in my Home Assistant over the last 2 years.

I was keen to migrate this data to InfluxDB, so wrote a small app. It currently supports only Sensor data, but I’ll be working on other items, as I’ll need the rest as well.

You and anyone interested can find it here: https://github.com/mrvladis/hamysqldb2influxdb

Thanks.

1 Like

There’s also this script if your database is MariaDB or the original SQLite home-assistant_v2.db

What I have to do with git clone <this repository> migrate2influxdb? I don’t understant what I have to write inside <this repository>.

This: