Introduction
Upgrading MariaDB, an open-source relational database management system (RDMS), is widely used in various applications, including content management systems like WordPress. Update is a critical step in ensuring that your database stays safe, and reliable, and gains new capabilities. This blog article will walk you through the process of updating MariaDB on a Debian-based server from version 10.5 to the newest 10.11 LTS version. In addition, we'll go over how to backup your current databases to ensure data integrity during the upgrading process.
Step 1: Preparing for the Upgrade
1.1 Verify that you have a recent backup of all your databases or your application should have a copy of your database. It's crucial to have a backup to restore your data in case of any unforeseen issues during the upgrade process. Most importantly, double-check that your application is supported for this version of MariaDB before upgrading.
Most of the tasks we'll be running will require your sudo/root password, so make sure you have Superuser access to the system.
1.2 Use the following command to create a complete backup of all databases:
sudo mysqldump --all-databases > backup.sql
This command will generate a file named "backup.sql" containing your entire database structure and data.
Step 2: Preparing the System
2.1 Ensure that your Debian system is up to date by running the following commands:
sudo apt upgrade && sudo apt upgrade -y
2.2 Before proceeding with the upgrade, stop the MariaDB service to prevent any interference during the process. When uninstalling MariaDB, it's crucial to be cautious to avoid deleting important data and ensure a smooth removal (such as default is /var/lib/mysql ).
sudo systemctl stop mariadb
2.3 Uninstall MariaDB: Execute the appropriate command based on your Debian package manager:
sudo apt remove mariadb-server && sudo apt autoremove
These commands will remove the MariaDB old server package from your system.
2.4 (optional remove if the installation has an issue) Remove configuration files: Some configuration files may remain even after uninstallation. To remove them, run the following command: sudo rm -rf /etc/mysql/
Step 3: Upgrading MariaDB to Version 10.11 LTS
To install MariaDB on Debian, follow these steps:
3.1 Visit the following URL in your web browser: MariaDB Download.
3.2 On the download page, you will find various options. Look for the "Debian" version of release and select it.
3.3 Choose the desired MariaDB version from the available options.
3.4 The page will display the installation source for your selected options. It will provide the repository configuration details that you need to add to your system.
3.5 Copy the repository configuration information, which typically includes a repository URL, GPG key import command, and repository definition.
3.6 Update the package list by running:
sudo apt update
3.7 Install the desired version of MariaDB by executing the following command:
sudo apt install mariadb-server
Install MariaDB and package dependencies. Installing additional packages may require additional plugins.
3.8: Verify the upgrade, and start and enable the MariaDB service:
sudo systemctl start mariadb
sudo systemctl enable mariadb
Check the MariaDB version to ensure that the upgrade was successful: mysql --version
3.9 Run the following program after starting the server processes to update the data directory. MariaDB includes the MariaDB-upgrade software, which detects and corrects compatibility issues in the most recent version. If you are told that you have run previously and wish to do it again, you may just run it again.
sudo mariadb-upgrade
after that, you may want to check and restart the service and make sure no error has occurred: sudo systemctl restart mariadb , finally, double-check the status to ensure there are no new errors, and double-check the status messages as well: sudo systemctl status mariadb .
3.10 Check that your frontend application is functioning properly.
Restore Backup Data (if required)
Just mention that for some reason, this version does not work for you, or that you need to totally wipe everything about MarieDB from the system using the purge command, which may include the old data in the directory, in which case you will need to import the previous backup data. Run the following command in the data backup directory to restore the databases:
sudo mysql < backup.sql
This will import the backup file and restore your databases.
Reference
Upgrading MariaDB from mariadb.com: https://mariadb.com/kb/en/upgrading/


Comments NOTHING