Score:0

clone a grafana setup to a different server

ua flag

I'm writing a set of scripts to automatically setup any virgin ubuntu server to be in a state usable for my production environment.

One of the things I want to do is setup grafana so that, on install, it has already added prometheus as a datasource, has a dashboard setup, and any other configuration steps already done, without having to touch the graphical interface.

For that, I thought I could set up grafana in a development server, and save the entire configuration directories in gitlab, to copy that configuration into any new server.

Is this something that can be done? And, which directories should I save in version control to completely copy the local grafana setup?

Score:0
us flag

Grafana saves all of it's configuration (dashboards, panels, users etc.) in a database. By default it is a local sqlite3 database (this can be changed, check /etc/grafana/grafana.ini file, [database] section).

To migrate Grafana instance you would have to dump it's database to a file, and then recreate database from this file. Information how to do this is available in official documentation.

Other than that, you would also have to copy /etc/grafana/grafana.ini config file, if you made any changes to the defaults.

Score:0
cn flag

Instead of copying grafana directories, you should take a look at Provisioning Grafana. This is the supported method to automate Grafana provisioning, by creating Data Sources, Dashboards, etc...

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.