Upgrading MariaDB manually

Working and tested!!!

Requirements:

  1. A server running Ubuntu 20.04 LTS.
  2. A version of MariaDB running that is not the latest.
  3. Root access to the server.
  4. Cyber Panel in lastest version

Upgrade MariaDB in Ubuntu 20.04 LTS

First update and upgrade your system:

$ sudo apt upgrade && sudo apt upgrade -y

A MariaDB upgrade in Ubuntu requires uninstalling the old version and installing the new version. The best practice is to take a backup before changing the existing server if issues arise.

These issues may corrupt the database files, preventing you from quickly reverting to the older version. A backup allows restoration if needed and can be deleted once the upgrade is successful.

Step 1: Backup MariaDB (use your way…)

Step 2: Stop MariaDB

Stop MariaDB from running using the following command.

$ sudo systemctl stop mariadb

Step 3: Uninstall the Old Version of MariaDB

The upgrade process requires uninstalling the old version before installing the new version of MariaDB. Use the following command to uninstall the previous version.

$ sudo apt-get remove mariadb-server

Step 4: Install the Latest Version of MariaDB on Ubuntu

Install the latest version of MariaDB via the APT package manager (Debian/Ubuntu).

  1. Configure the APT package repository. This step involves adding a key for the MariaDB server repo and then updating.

$ sudo apt install wget

$ wget https://downloads.mariadb.com/MariaDB/mariadb_repo_setup

$ echo "fd3f41eefff54ce144c932100f9e0f9b1d181e0edd86a6f6b8f2a0212100c32c mariadb_repo_setup"

$ chmod +x mariadb_repo_setup

$ sudo ./mariadb_repo_setup \ --mariadb-server-version="mariadb-10.11"

$ sudo apt update

  1. Install MariaDB and package dependencies. Installing additional packages may require additional plugins.

$ sudo apt install mariadb-server

  1. Once you start the server processes, run the below utility to upgrade the data directory. MariaDB comes with the mariadb-upgrade utility, which identifies and corrects the compatibility issues in the latest version.

$ sudo mariadb-upgrade

  1. You can now enable and start MariaDB with the following command.

$ sudo systemctl enable mariadb
$ sudo systemctl start mariadb

that’s it… it worked very well in this environment

Ubuntu 20.04
Cyber Panel latest version

3 Likes