This is documentation for the next version of Grafana. For the latest stable release, go to the latest version.
Back up Grafana
This topic explains how to back up a local Grafana deployment, including configuration, plugin data, and the Grafana database.
Back up the Grafana configuration file
Copy Grafana configuration files that you might have modified in your Grafana deployment to a backup directory.
The Grafana configuration files are located in the following directories:
- Default configuration:
- Custom configuration:
Note: If you installed Grafana using the
rpmpackages, then your configuration file is located at
/etc/grafana/grafana.ini. This path is specified in the Grafana
Back up plugin data
Installing plugins in Grafana creates a folder for each plugin with its associated files and data. Copy all files and folders recursively from this location to your backup repository.
The Grafana plugin files are located in the following directories:
- Default location for plugins in a binary or source installation:
- Default location for plugins in a
/var/lib/grafana/plugins. This path is specified in the Grafana init.d script using
Back up the Grafana database
We recommend that you back up your Grafana database so that you can roll back to a previous version, if required.
The default Grafana database is SQLite, which stores its data in a single file on disk. To back up this file, copy it to your backup repository.
Note: To ensure data integrity, shut down your Grafana service before backing up the SQLite database.
The SQLite database file is located in one of the following directories:
- Default location for SQLite data in a binary or source installation:
- Default location for SQLite data in a
/var/lib/grafana/grafana.db. This path is specified in the Grafana init.d script using
To back up or restore a MySQL Grafana database, run the following commands:
backup: > mysqldump -u root -p[root_password] [grafana] > grafana_backup.sql restore: > mysql -u root -p grafana < grafana_backup.sql
To back up or restore a Postgres Grafana database, run the following commands:
backup: > pg_dump grafana > grafana_backup restore: > psql grafana < grafana_backup