Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to completely copy Grafana dashboard(s) from one server to other server

Tags:

grafana

I have 20 plus dashboards in Grafana hosting at Server1. We acquired another server and we did installed same version of Grafana on Server2 machine.

I want to know is this possible that i can completely clone Server-1 Grafana instance along with all dashboards to Server2?

As of now Grafana only supports one by one dashboard import and export.

One other possibility i am thinking is to copy all Grafana files/directories from Server-1 to server-2 using standard SCP command. But i am not sure which files do i need to copy.

like image 711
Ammad Avatar asked Feb 04 '17 05:02

Ammad


People also ask

How do I copy a Grafana dashboard to another server?

To import a dashboard, choose the + icon in the side menu, and then choose Import. You can upload a dashboard JSON file, paste a dashboard URL or paste dashboard JSON text directly into the text area.

How do you clone a Grafana dashboard?

Duplicate a Dashboard Grafana lets you create an identical copy of any dashboard by performing the following: From the Home page, open a dashboard by clicking on one of the listed dashboard entries. Click the Gear icon at the top right corner. Select 'Save As' and provide a new dashboard name.

How do I export and import dashboard in Grafana?

Export your Grafana dashboard To export Grafana dashboards: Create a dashboard in a Grafana instance and save it. In the dashboard menu, click Share dashboard to export the dashboard to your computer. On the Export tab, enable to share externally and click Save to file.


2 Answers

If you are using the built-in sqlite3 database, then you can indeed just copy your data directory and conf/custom.ini to the new server and that will include all your dashboards, plugins, etc. In that setup the database is contained in data/grafana.db under your grafana installation.

like image 163
AussieDan Avatar answered Sep 20 '22 12:09

AussieDan


You can use wizzy to copy dashboards from one server to another.

Install wizzy using instructions at https://grafana-wizzy.com/home/getting-started/

Then run the following commands:

Set config for server 1:

wizzy set grafana envs local1 url http://server1:3000
wizzy set grafana envs local1 username admin
wizzy set grafana envs local1 password admin

Set config for server 2:

wizzy set grafana envs local2 url http://server2:3000
wizzy set grafana envs local2 username admin
wizzy set grafana envs local2 password admin

Copy from server 1 to server 2:

wizzy set context grafana local1
wizzy import dashboards
wizzy set context grafana local2
wizzy export dashboards

Your dashboards should be copied now from server 1 to server 2. If there are any issues, please open a GitHub issue on https://github.com/grafana-wizzy/wizzy/issues

like image 20
utkarshcmu Avatar answered Sep 18 '22 12:09

utkarshcmu