2016-10-21 04:01:34 -05:00
+++
title = "Export & Import"
keywords = ["grafana", "dashboard", "documentation", "export", "import"]
type = "docs"
[menu.docs]
parent = "dashboard_features"
weight = 8
+++
2015-03-10 02:55:42 -05:00
# Export and Import
2016-12-08 02:14:58 -06:00
Grafana Dashboards can easily be exported and imported, either from the UI or from the HTTP API.
2016-10-21 04:01:34 -05:00
2015-08-10 17:19:56 -05:00
## Exporting a dashboard
2016-06-21 11:24:25 -05:00
Dashboards are exported in Grafana JSON format, and contain everything you need (layout, variables, styles, data sources, queries, etc)to import the dashboard at a later time.
2015-08-10 17:19:56 -05:00
2016-06-21 11:24:25 -05:00
The export feature is accessed from the share menu.
2015-08-10 17:19:56 -05:00
2016-11-04 14:29:17 -05:00
< img src = "/img/docs/v31/export_menu.png" >
2015-08-10 17:19:56 -05:00
2016-06-23 06:21:30 -05:00
### Making a dashboard portable
If you want to export a dashboard for others to use then it could be a good idea to
2016-12-08 02:14:58 -06:00
add template variables for things like a metric prefix (use constant variable) and server name.
2016-06-23 06:21:30 -05:00
2016-12-08 02:14:58 -06:00
A template variable of the type `Constant` will automatically be hidden in
2016-06-23 06:21:30 -05:00
the dashboard, and will also be added as an required input when the dashboard is imported.
2015-08-10 17:19:56 -05:00
## Importing a dashboard
2016-06-23 10:31:22 -05:00
To import a dashboard open dashboard search and then hit the import button.
2016-06-21 11:24:25 -05:00
2016-11-04 14:29:17 -05:00
< img src = "/img/docs/v31/import_step1.png" >
2016-06-21 11:24:25 -05:00
2017-03-20 04:20:32 -05:00
From here you can upload a dashboard json file, paste a [Grafana.com ](https://grafana.com ) dashboard
2016-06-21 11:24:25 -05:00
url or paste dashboard json text directly into the text area.
2016-11-04 14:29:17 -05:00
< img src = "/img/docs/v31/import_step2.png" >
2016-06-21 11:24:25 -05:00
In step 2 of the import process Grafana will let you change the name of the dashboard, pick what
data source you want the dashboard to use and specify any metric prefixes (if the dashboard use any).
2017-03-20 04:20:32 -05:00
## Discover dashboards on Grafana.com
2016-06-21 11:24:25 -05:00
2017-03-20 04:20:32 -05:00
Find dashboards for common server applications at [Grafana.com/dashboards ](https://grafana.com/dashboards ).
2016-06-21 11:24:25 -05:00
2016-11-04 14:29:17 -05:00
< img src = "/img/docs/v31/gnet_dashboards_list.png" >
2016-06-21 11:24:25 -05:00
2016-06-21 11:25:24 -05:00
## Import & Sharing with Grafana 2.x or 3.0
2016-06-21 11:24:25 -05:00
2017-03-20 04:20:32 -05:00
Dashboards on Grafana.com use a new feature in Grafana 3.1 that allows the import process
2016-06-21 11:24:25 -05:00
to update each panel so that they are using a data source of your choosing. If you are running a
Grafana version older than 3.1 then you might need to do some manual steps either
before or after import in order for the dashboard to work properly.
Dashboards exported from Grafana 3.1+ have a new json section `__inputs`
that define what data sources and metric prefixes the dashboard uses.
Example:
```json
{
"__inputs": [
{
"name": "DS_GRAPHITE",
"label": "graphite",
"description": "",
"type": "datasource",
"pluginId": "graphite",
"pluginName": "Graphite"
},
{
"name": "VAR_PREFIX",
"type": "constant",
"label": "prefix",
"value": "collectd",
"description": ""
}
],
}
```
These are then referenced in the dashboard panels like this:
```json
{
"rows": [
{
"panels": [
{
"type": "graph",
"datasource": "${DS_GRAPHITE}",
}
]
}
]
}
```
These inputs and their usage in data source properties are automatically added during export in Grafana 3.1.
2017-03-20 04:20:32 -05:00
If you run an older version of Grafana and want to share a dashboard on Grafana.com you need to manually
2016-06-21 11:24:25 -05:00
add the inputs and templatize the datasource properties like above.
2017-03-20 04:20:32 -05:00
If you want to import a dashboard from Grafana.com into an older version of Grafana then you can either import
2016-06-21 11:24:25 -05:00
it as usual and then update the data source option in the metrics tab so that the panel is using the correct
data source. Another alternative is to open the json file in a a text editor and update the data source properties
to value that matches a name of your data source.
2015-08-10 17:19:56 -05:00