How to Upgrade MariaDB 5.5 to MariaDB 10.0 & MariaDB 10.1 on Linux

MariaDB is a drop-in alternative for MySQL. MariaDB is an opensource Relational Database Management System (RDBMS) which supports database access. MariaDB provides more storage engines than MySQL, such as Cassandra (NoSQL, in MariaDB Edition 10), XtraDB (drop-in alternative for InnoDB), and OQGRAPH (in MariaDB Edition 10).
In this article I will explain how to upgrade MariaDB,There are no changes in table or index formats on MariaDB 5.5, MariaDB 10.0 & MariaDB 10.1. So, In most servers the upgrade should be painless from MariaDB 5.5 to MariaDB 10.0 & MariaDB 10.1.

Prerequisities

  1. These guidelines are intended for Upgrading MariaDB  5.5 to MariaDB 10.0 & MariaDB 10.1
  2. SSH client like Putty and proper knowledge to use it.
  3. Some basic knowledge about common Linux commands.
  4. 20 minutes of your time with a cup of tea or coffee as always.

Step 1- Backup Database

For the safety purpose we have to take backup before proceeding MariaDB upgrade, this will help you to restore the database in case something goes wrong.
Just run the below commands to take a backup of entire MariaDB on CentOS, RHEL, Fedora, Debian, Mint & Ubuntu Systems.

For Database Backup 
mysqldump -u root -p --all-databases > db-backup.sql

Step 2- Shutdown and uninstall MariaDB 5.5

Use the below commands to Shutdown and uninstall MariaDB 5.5 on CentOS, RHEL, Fedora, Debian, Mint & Ubuntu Systems.

For Sysvinit systems
service mysql stop
For Systemd systems 
systemctl stop mariadb.service
Uninstall MariaDB on Debian based Systems 
apt-get purge mysql* mariadb*
apt-get autoremove
apt-get autoclean
Uninstall MariaDB on RPM based Systems
yum remove mysql* mariadb*
yum clean

Step 3- Add MariaDB 10.1 Repo & Install

We have already Discuss in our previous article, how to install MariaDB 10.1 On CentOS, Fedora & RHEL. You can follow the steps there to add MariaDB 10.1 Stable Repo and install it.

Step 4- How to Upgrade MariaDB 10.1

After doing the MariaDB 10.1 installation, start the MariaDB service. By default Debian based system perform upgrade (While doing upgrade, it will upgrade the tables permission & Check table compatibility with MariaDB 10.1) but in RPM based systems we need to run upgrade manually.

For Sysvinit systems
service mysql start
For Systemd systems
systemctl start mariadb.service
Run MariaDB Upgrade on CentOS, RHEL & Fedora
mysql_upgrade

Step 5- Verify MariaDB Upgrade

Now just login to MariaDB server and check the upgraded version also check the databases.

mysql -u root -p
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 3>
Server version: 10.1.11-MariaDB MariaDB Server
Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input 
statement.
MariaDB [(none)]>

So this is all you have to do, Please Give your opinion below if you experience any issues or to discuss your ideas and experiences.