How to Move/Migrate Grafana to a newer version/system on a local/container environment

Hi, I want to migrate a grafana installation (v 5.3.4) to a new server.
Is there a guide\docs or best practices to move grafana (without losing data,plugins, configurations, dashboard, datasource, …) from an old server to a newer?

Old Server OS: Ubuntu 16.04
New Server OS: Debian 9.6.0

Thanks !

1 Like

I didn’t find any good doc about it.
I only find this: http://docs.grafana.org/installation/upgrading/#database-backup

Maybe this topic might help you:

https://community.grafana.com/t/backup-restore-grafana-server/121

If it does not work let us know again.

ok. thx.
I will carry out the migration and give feedback.

bye

Hi, it works.

Step:

  1. Install new instance of Grafana
  2. Install used plugin on new server
  3. Stop Grafana service on source and destination server
  4. Copy /var/lib/grafana/grafana.db from old to new server
  5. Check /etc/grafana/grafana.ini
  6. Restart Grafana
  7. Regular connection to the grafana url
  8. Dashboard, datasource, users, psw, team,… are the same

Great !
thanks. bye.

8 Likes

Just wanted to say that it’s still working in 2021 with grafana 8.x!

3 Likes

I can confirm. Just upgrade from 7.3.3 to 8.0.1 without issues this way!

Hi,

What about Grafana license.Will it work ?

Er, what licence?

Grafana is licensed under GNU AGPL 3.

Antony.

Hi,

I am using Grafana Enterprise.i want to move my grafana from current environment to a different Environment.
i just want to know the the license will work or not?

1 Like

Still works in version 9.2.0

My workflow:
sudo systemctl stop grafana-server.service
sudo chown --reference=/var/lib/grafana/grafana.db grafana.db
sudo cp grafana.db /var/lib/grafana/grafana.db
sudo systemctl restart grafana-server.service

don’t forget:

sudo systemctl enable grafana-server.service

3 Likes

My workflow for Grafana 9.2.2 (a little more detailed):

  1. In a terminal:
    docker inspect grafana_old_container_name | grep Source
    If you cannot use grep just use docker inspect grafana_old_container_name and search for the line Source
  2. Go to the Source folder and copy all files and folders except public and bin folders.
    The grafana.db file has your dashboards, configurations etc., so you can take backups, keep it somewhere else etc. The plugins folder has the installation of your plugins (not the configuration, as it’s included in the grafana.db). I found that public and bin folders are the big ones, but for my configuration everything worked fine without copying them (i guess they will be recreated).
  3. Create a new folder:
    mkdir grafana_new
  4. enter this folder:
    cd grafana_new
    and paste the folders and files you copied before.
  5. create the new container (from inside the grafana_new folder):
    docker run -d -p 3000:3000 --name=grafana_new -v $(pwd):/var/lib/grafana grafana/grafana-enterprise
  6. Enjoy
1 Like