Backup Grafana, what files are needed?

Hello
Is it correct that i only need to save the lib/grafana/ directory to restore grafana on a new system? i search for the correct way to safe all, if the system crash down and i need to reinstalll ubuntu

Thank you

1 Like

It’s a bit more invovled than just that one directory, and it depends on what you’ve got installed and set up, but here’s a set of instructions, hopefully this helps.

Backup:

  1. Backup the Grafana configuration file (grafana.ini).
  2. Backup the Grafana database (grafana.db): The db stores all the dashboards, users, and other metadata. You can find the location of the database in the grafana.ini file under the [database] section. Make sure to have a copy
  3. Backup the Grafana provisioning directory (if applicable): If you have any custom provisioning files or plugins, make sure to back up the entire provisioning directory. The location of the provisioning directory can be found in the grafana.ini file under the [provisioning] section.
  4. Backup any additional data sources and dashboards: If you have configured external data sources or have created custom dashboards, make sure to back up the necessary files or configurations associated with them.

Restore

  1. Install as usual
  2. Stop the Grafana service
  3. Restore the configuration file (grafana.ini)
  4. Restore the Grafana database (grafana.db). Make sure file has the correct permissions (chown grafana:grafana grafana.db).
  5. Restore the Grafana provisioning directory (if you had one)
  6. Restart the Grafana service

This should do the trick.

1 Like

thank you a lot!
best regards

1 Like