Skip to content

Upgrading MariaDB LTS

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 11.4 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 11.4 from 10.11. 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 11.4 instead of 10.11
  4. Run apt update
  5. Install mariadb 11.4 with apt install mariadb-server. This also upgrades mariadb-common and removes old mariadb 10.11 packages still existing after the mariadb-server uninstall.
  6. If 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='11.4' WHERE engine = 'MariaDB' AND host='127.0.0.1'" to update the CloudPanel UI to reflect your new version in the database servers list.