Upgrading Grafana from 7.0 to 8.0 in Ubuntu

Search for a command to run...

No comments yet. Be the first to comment.
Bun, the hyper-fast JavaScript runtime known for its incredible speed and Zig-based architecture, is being completely rewritten in Rust. For a project that has over 22 million monthly downloads and ea

Next.js 16.3 is almost here, and it's packed with a ton of improvements and let's see them in this post 1.Instant Navigation For a while now, there’s been a valid, lingering debateServer Components vs

It’s official. React has merged its long-awaited Rust port of the React Compiler (formerly known as React Forget) into the main repository. What started as an experimental research project by Joseph S

If you follow modern technology trends, you have likely been led to believe that artificial intelligence is entirely built on Python. Every tutorial, machine learning framework documentation, and open

Just when the JavaScript ecosystem was catching its breath after last week’s TanStack Router compromise, the Mini Shai-Hulud supply chain worm has continued its relentless march. Developed by the thre

Source: Nidhinkumar
In this post, we will see how to upgrade Grafana to the latest version in Ubuntu
What is Grafana
What’s new in Grafana v8.0
Database Backup
Upgrade Grafana
Updating Plugins
Restart grafana-server
Grafana is an open-source visualization tool. It does not store data but consumes data sources to create real-time graphs displayed on custom dashboards.
The data source includes InfluxDB, Prometheus, Graphite, CloudWatch, and more.

Source: Nidhinkumar
Grafana Open source edition contains the following features in v8.0
Grafana V8.0 alerts
Library Panels
Real-time streaming
Bar chart & State time visualization
Status history & Histogram visualization
Time series visualization updates
Node graph & Pie chart updates
Panel editor updates
Click here to know more about What’s new in Grafana 8.0

Source: Nidhinkumar
Now let’s begin upgrading Grafana v7.0 to v8.0 in Ubuntu
Before upgrading it is good to take a backup of the database as well as the plugins installed
During startup, Grafana will automatically migrate the database schema (if there are changes or new tables). Sometimes it might cause issues if you later want to downgrade
Since we are using SQLite as the database for Grafana(default one) we would do the following steps to take a backup
Navigate to /var/lib/grafana/grafana.db and copy the grafana.db to a folder.
If you installed Grafana in a custom location using a binary tar/zip it is usually in grafana_install_dir>/data
If you have used MySQL as the database for Grafana then follow the below steps
backup:
> mysqldump -u root -p[root_password] [grafana] > grafana_backup.sql
restore:
> mysql -u root -p grafana < grafana_backup.sql
If you have used Postgres as the database for Grafana then follow the below steps for backup
backup:
> pg_dump grafana > grafana_backup
restore:
> psql grafana < grafana_backup

Source: Nidhinkumar
Let’s upgrade Grafana to the latest version
If you have installed Grafana by downloading a Debian package (.deb) then you can execute the same dpkg -i command with the new package which will upgrade your Grafana installation
Go to the download page for the latest download links
wget <debian package url>
sudo apt-get install -y adduser libfontconfig1
sudo dpkg -i grafana_<version>_amd64.deb
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.
sudo apt-get update
sudo apt-get upgrade
.tar fileIf you downloaded the binary .tar.gz package, then you can just download and extract the new package and overwrite all your existing files. However, this might overwrite your config changes.
It is recommended that you save your custom configuration changes in a file named <grafana_install_dir>/conf/custom.ini. This allows you to upgrade Grafana without risking losing your configuration changes.
The below snippet is an example of how to update Grafana in Docker but it depends on how you have configured your container
docker pull grafana/grafana
docker stop my-grafana-container
docker rm my-grafana-container
docker run -d --name=my-grafana-container --restart=always -v /var/lib/grafana:/var/lib/grafana grafana/grafana
If you downloaded the Windows binary package you can just download a newer package and extract it to the same location (and overwrite the existing files). This might overwrite your configuration changes. It is recommended that you save your configuration changes in a file named <grafana_install_dir>/conf/custom.ini as this will make upgrades easier without risking losing your configuration changes.

Source: Nidhinkumar
Once we upgraded Grafana now we will update the plugins. You can update all plugins using
grafana-cli plugins update-all

Source: Nidhinkumar
Now we have upgraded our Grafana to v8.0 it’s time to restart the grafana-server using the below command
sudo service grafana-server restart
Now open Grafana in your localhost with the following port number localhost:3000 where you could see the updated version of Grafana like below

Upgraded Grafana v8.0

Updated Panel
Watch the installation in Youtube
You have learned how to upgrade Grafana from v7.0 to v8.0 in Ubuntu. Now you can play around with the latest features in v8.0.
Catch you up in a new post till then Happy Learning!