Grafana backup and restore OR sqlite to postgres

We want to change our Grafana from sqlite to postgres. I found a few ways to backup Dashboards and Datasources. I didn’t find a way to backup Organizations.
How can I backup Organizations? Is there anything else that we need to backup?


It is quite to backup the whole sqlite db:

sqlite3 my_database .backup > my_database.back

or dump to sql: sqlite3 my_database .dump > my_database.back

Not sure about the best way to restore it to Postgres but it should be possible.

Backup and restore to the same db type is indeed easy. The problem is to change db type.
I think that the best way is to backup the different entities seperatly via the Grafana api. I found how to backup the dashboards and data sources.
How do I backup Organizations? Which other entities do I need to backup?

Have you looked at wizzy?

It can import datasources, dashboards and organizations from live Grafana server to local file storage and export them from local file storage to live Grafana (have not tried it myself though).

So your steps might look like:

  1. Import datasources, dashboards and organizations from Grafana with sqlite db
  2. Reconfigure Grafana to use postgres
  3. Export data back to Grafana.
1 Like