Skip to content

Python script to migrate ioBroker MySQL (SQL History Adapter) data to influxDB (Logging data with influxDB)

Notifications You must be signed in to change notification settings

JackGruber/iobroker_mysql_2_influxdb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Migrate ioBroker history datapoints from MySQL to influxDB

Python script to migrate ioBroker MySQL (SQL History Adapter) data to influxDB (Logging data with influxDB)

Based on a script from UlliJ from the ioBroker Forum

I have used the script to migrate 22 million records from a MySQL DB running on a Rasperry Pi to an influxDB on a Synology.

Infos

  • Run pip install -r requirements.txt to install all requirements
  • The script processes the measuring points from ts_number, ts_bool and ts_string
  • The data is retrieved in a batch of 100,000 data sets per measuring point and sent to influxDB in batches of 1,000 and the progress is displayed.
  • Rename database.json.example to database.json and adjust the values for host, port, user, passwd and db to your enviroment. When your InfluxDB has no user/password change the values to an empty string.
  • To migrate all datapoints run migrate.py ALL, to migrate one datapoint run migrate.py "hm-rega.0.NEQ1332020" or migrate.py "hm-rega.0.%" to migrate all hm-rega.0 datapoints

About

Python script to migrate ioBroker MySQL (SQL History Adapter) data to influxDB (Logging data with influxDB)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages