Blocking ads removes funding from us!
Researching and writing articles takes a lot of time. Operating our infrastructure costs money.
All of this is funded with advertising revenue.
We don't like advertising either - that's why we avoid annoying banners and pop-ups.
Please give us a chance and deactivate your adblocker!
Alternatively, you can support us here voluntarily.

Follow us:

Upgrade from MySQL 5.x to MariaDB 10.x under Debian / Ubuntu at Plesk - this is how it works!

Plesk Obsidian MariaDB logo
(Post picture: © 2021

Many admins use the Plesk tool to manage their websites. In this guide we show how the Plesk database is updated from MySQL 5.x to MariaDB 10.x under Debian or Ubuntu.

In our previous guide we have already shown the steps to generally upgrade from MySQL 5.x to MariaDB 10.x without Plesk. In the following the slightly adapted instructions for updating under Plesk.

Replace MySQL 5.x with MariaDB 10.x on Plesk

  1. Log in to the Plesk server as a root user via SSH.
  2. Create a backup! The database tables, at best the entire server, should be backed up before the upgrade, as an upgrade can sometimes go wrong. A database dump is performed on a Plesk server as follows:
    MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysqldump -u admin --verbose --all-databases --routines --triggers > /root/datenbank-backup.sql
  3. So that we can start, MySQL must be updated to the latest version (5.7) and Plesk must run on at least version Plesk Obsidian 18.0.30. The Plesk version is updated in the web interface, the packages (like MySQL) with the usual commands:
    apt-get update
    apt-get upgrade
  4. Check database version - In the best case scenario, MySQL should now run on version 5.7:
    plesk db
  5. This command should give the following, similar result:
    Welcome to the MySQL monitor. Commands end with ; or \g.
    Your MySQL connection id is 2187338
    Server version: 5.7.35-0ubuntu0.21.04.1 (Ubuntu)
  6. Add MariaDB repository - auf dieser seite choose the Debian or Ubuntu version used. Then the commands displayed must be carried out. For example the following for a server with Ubuntu 21.04 ("hirsute") and a desired upgrade to MariaDB 10.7:
    apt-get install software-properties-common dirmngr apt-transport-https
    apt-key adv --fetch-keys ''
    add-apt-repository 'deb [arch=amd64,arm64,ppc64el] hirsute main'
  7. Shut down the MySQL server (on older systems the service may still be called "mysqld"):
    service mysql stop
  8. If the repository and the key from above have been added successfully, the installation of MariaDB will now be carried out. This will remove the old MySQL packages, that's fine.
    apt update
    apt install mariadb-server
  9. Upgrade the database tables on MariaDB:
    MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql_upgrade -uadmin
  10. Then check that MariaDB has been installed properly. Execute the following command to log into the database:
    plesk db
  11. This should deliver the following, similar result:
    Welcome to the MariaDB monitor. Commands end with ; or \g.
    Your MariaDB connection id is 473
    Server version: 10.7.1-MariaDB-1:10.7.1+maria~hirsute binary distribution
  12. In order for Plesk to take over the replaced database in the package manager, two last commands have to be executed:
    plesk bin service_node --update local
    plesk sbin packagemng -sdf
  13. It is now advisable to check whether all services and websites connected to the database can be reached. Normally, all services compatible with MySQL 5.5-5.7 should work with MariaDB 10 as well. This guarantee is no longer given for future versions of MariaDB.

Upgrade from MySQL 8.x to MariaDB 10.x at Plesk

MariaDB 10.x is a "drop-in" replacement, but only for MySQL versions 5.5 to 5.7. This means that no migration work is necessary afterwards. Future versions of MySQL and MariaDB will differ technically in some points and will no longer be easily replaceable. So if you have already updated to MySQL 8, you have to back up all database tables manually and migrate them to MariaDB. Unfortunately this is the only way, also vice versa (from MariaDB 10.x to MySQL 8.x). There is further support in one Instructions at MariaDB.

Recommendations for you

>> The best Amazon deals <

David Wurm

Do that TechnikNews-Ding together with a great team for several years. Works in the background on the server infrastructure and is also responsible for everything editorial. Is fascinated by current technology and likes to blog about everything digital. In his free time, he can often be found developing websites, taking photos or making radio.

David has already written 920 articles and left 376 comments.

Web | Facebook | Twitter | Insta | YouTube
notification settings
notifications about
Your name, which will be shown publicly.
We will not publish your email address.

Inline feedback
View all comments