How to Upgrade from Grafana 5 to Grafana 6 on Ubuntu / Debian, Centos / RHEL and Docker

How to Upgrade from Grafana 5 to Grafana 6 on Ubuntu / Debian, Centos / RHEL and Docker


We need to upgrade to stay up to date with the latest fixes and enhancements. Let's list down the Procedure to upgrade.

grafana

1. Take backup:


As we are upgrading from One Major version to another, its recommended to take backup. This will ensure that you can always rollback to your previous version. During startup, Grafana will automatically migrate the database schema. Sometimes this can cause issues if you later want to downgrade.

a. Take a backup of configuration file to /etc/grafana/grafana.ini being cautuios.
b. The backup procedure is different based on the Database that is used.


sqlite :

If you use sqlite you only need to make a backup of your grafana.db file. This is usually located at /var/lib/grafana/grafana.db on Unix systems.

mysql :

backup:
> mysqldump -u root -p[root_password] [grafana] > grafana_backup.sql

restore:
> mysql -u root -p grafana < grafana_backup.sql

For more detailed procedure on mysql Backup/restore Procedure please follow Go to : How to Take Backup Of MySQL/MariaDB  Database and Restore it 

postgres :

backup:
> pg_dump grafana > grafana_backup

restore:
> psql grafana < grafana_backup

For more detailed procedure on mysql Backup/restore Procedure please follow Go to : How to Take Backup & Restore in PostgreSQL Database

Upgrade Now: 

Ubuntu / Debian :

If you installed grafana by downloading a debian package (.deb). You can Download the new package from Grafana Website. Then do the following It will upgrade your Grafana install.

dpkg -i <new grafana package.deb>

For Detailed Grafana Installation Guide : How to Install Grafana 6 on ubuntu / Debian

 
 
If you used APT repository:

unisonunix02# apt-get update
unisonunix02# apt-get install grafana

Centos / RHEL :

If you installed grafana by downloading a rpm package. You can Download the new package from Grafana Website. Then do the following It will upgrade your Grafana install.

rpm -i <new grafana package.rpm>

For Detailed Grafana Installation Guide : How to Install Grafana 6 on CentOS / RHEL 

If you used YUM repository:

unisonunix02# yum update grafana

Docker :


This just an example, details depend on how you configured your grafana container.

Pull latest grafana Image:
docker pull grafana

Stop Running Grafana instance:
docker stop my-grafana-container

Remove Existing Grafana Container:
docker rm my-grafana-container

Now start new grafana Container With new image:

docker run --name=my-grafana-container --restart=always -v /var/lib/grafana:/var/lib/grafana

0 Comments