12

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

dejanualex
  • 3,872
  • 6
  • 22
  • 37
blak3r
  • 16,066
  • 16
  • 78
  • 98
  • 3
    Some comments on why close votes happened would be appreciated. Grafana server management questions are hardly "questions about general computing" software. At least a comment on which other stack exchange site might be better suited would be a more productive approach. – arturomp Oct 09 '20 at 22:37

2 Answers2

11

That should do it.

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

Carl Bergquist
  • 3,894
  • 2
  • 25
  • 42
  • 1
    Thank you, i have confirmed this works and updated the procedure in my question to outline it step by step. – blak3r Dec 07 '16 at 20:25
2

One Update:

  • works like charme
  • do not forget to update the password(!) of your data sources - that is not copied.