CentOS Grafana How To's RHEL

How to Export and Import Grafana dashboard and Data Sources

[vc_row][vc_column][vc_column_text]In this article will guide you on how to export andimport Grafana dashboard and data sources,

You can use commands and steps below to export and import Grafana dashboard and data source configurations.

1. Export Dashboard click “Share” icon on top of the page and select “Export” tab to save it to a JSON file.
2. Import Dashboard while on Dashboard home page, click “Home” menu on the left top corner and select “Import dashboard” option to upload a JSON file.
3. Export Data Sources

Run command below in terminal.
[simterm]
$ curl -s “http://www.your-host.com/datasources” -u admin:grafana|jq -c -M ‘.[]’|split -l 1 – path/to/export/datasource/
[/simterm]

4. Restore Data Sources, Run command below in terminal.
[simterm]
$ for i in path/to/export/datasource/*; do \
curl -X “POST” “http://www.your-host.com/datasources” \
-H “Content-Type: application/json” \
–user admin:grafana \
–data-binary @$i
done
[/simterm]
[/vc_column_text][/vc_column][/vc_row]

Post Comment