How to migrate sqlite3 database to mysql for Grafana

First we have to convert Grafana.db file into dump.mysql

Use third party tool to convert the data from sqlite to mysql.

Like :

Now, run this command to restore the backup in mysql database.

mysql -u root -p db-name < dump.file.sql (restoring the backup)

After that start the mysqld database

systemctl start mysqld

Now stop and go to grafana.ini file and replace the database details in database section.

systemctl stop grafana-server

vim /etc/grafana/grafana.ini

[database] type = mysql
host = localhost:3306
name = grafana
user = [mysql database username]
password = [mysql database password]

After this restart the grafana service

systemctl start grafana-server

Now, go to Grafana console and validate the data, everything is fine.


Also checkout This Setup:-How to migrate Grafana Server

Leave a Reply

Your email address will not be published. Required fields are marked *