Skip to content

Upgrading MariaDB to a newer version

MariaDB is often updated to newer versions. Older CloudPanel installs offered to install MariaDB versions that were no LTS (long term support) releases and some of them are no longer supported. They also had their repositories removed so you will most likely see an error when trying to run apt update.

Here is a quick guide on how to upgrade MariaDB 10.x to the latest 10.11 LTS release.

Check with the maria db documentation to see what changes might have an impact on your applications. There are some guides here: https://mariadb.com/kb/en/upgrading/

These are the steps I followed to upgrade to mariadb 10.11 from 10.8. You can get your root credentials using clpctl db:show:master-credentials command line interface. You will need it in the steps. Adapt the steps based on your installed and target mariadb version:

  1. Stop the service with systemctl stop mysql
  2. Removed the old mariadb with apt remove mariadb-server
  3. Change the file /etc/apt/sources.list.d/mariadb.list to say 10.11 instead of 10.8
  4. Run apt update
  5. Install mariadb 10.11 with apt install mariadb-server. This also upgrades mariadb-common and removes old mariadb 10.8 packages still existing after the mariadb-server uninstall.
  6. When asked about the file 50-server.cnf answer n to not create that file
  7. Start the service with systemctl start mysql
  8. Run the upgrade command with mariadb-upgrade -u root -p -h 127.0.0.1. Here you will need your root password obtained from the clpctl db:show:master-credentials command.
  9. Run sqlite3 /home/clp/htdocs/app/data/db.sq3 "UPDATE database_server SET version='10.11' WHERE engine = 'MariaDB' AND host='127.0.0.1'" to update the CloudPanel UI to reflect your new version in the database servers list.