Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the best way to migrate grafana to a newer version? [closed]

What is the best-practice in terms of migrating grafana (configuration, dashboards etc.) to a a newer version ?

I want to migrate a v3 grafana installation to a new server which will be running the v4 codebase with alerting!

According to the docs, grafana v4 will automatically update the database schema once you start it so I assume this process is essentially:

  1. Install grafana v4 on new server.
  2. Copy the /var/lib/grafana/grafana.db from old server to the new one.
  3. Merge the /etc/grafana/grafana.ini file.
  4. Install any plugins
  5. Restart grafana-server

Is their anything I'm missing?

UPDATE:

What if grafana it's deployed as a docker container ? Bellow there's a docker-compose file which spins up a grafana 7.3.5 container, what files should I migrate to the container via mount volume ?

version: "3.1"
services:
 

  grafana_seven:
        image: "grafana/grafana:${NEW_TAG}"
        user: "${UID}:${GID}"
        container_name: newgrafana
        ports:
          - "3001:3000"
        volumes:
          - ./tmp_volume/graf_volume/new_grafana/:/var/lib/grafana

like image 335
blak3r Avatar asked Dec 07 '16 04:12

blak3r


People also ask

How do I update Grafana to latest version?

If you have installed Grafana from the APT repository, then Grafana will automatically update when you run apt-get upgrade to upgrade all system packages.

How do I backup my Grafana database?

Hi, it works. Step: Install new instance of Grafana Install used plugin on new server Stop Grafana service on source and destination server Copy /var/lib/grafana/grafana. db from old to new server Check /etc/grafana/grafana.

Where is Grafana data stored?

So where does Grafana store this file now? the dashboards are stored inside Grafana's internal DB, which is SQLite by default.


1 Answers

That should do it.

If your using sqlite you can just copy the data/grafana.db file to the new server.

like image 99
Carl Bergquist Avatar answered Sep 28 '22 02:09

Carl Bergquist