Hello everyone!

We have been investing plenty of personal time and energy for many years to share our knowledge with you all. However, we now need your help to keep this blog running. All you have to do is just click one of the adverts on the site, otherwise it will sadly be taken down due to hosting etc. costs. Thank you.

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


Export Dashboard


While Dashboard is open, click "Share" icon on top of the page and select "Export" tab to save it to a JSON file.


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.


Export Data Sources


Run command below in terminal.


$ curl -s "http://www.your-host.com/datasources" -u admin:grafana|jq -c -M '.[]'|split -l 1 - path/to/export/datasource/

Restore Data Sources


Run command below in terminal.


$ 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