Skip to content

Upgrading MariaDB LTS

Why upgrade

When you install CloudPanel, it will install the MariaDB version you selected for the installation at this time. There are a few reasons why you might want to upgrade: - The version of MariaDB is no longer suppored. It was possible in the past to install non-LTS versions of MariaDB when installing CloudPanel. These versions are since deprecated and their repos have been removed. You will know if this is the case when apt update shows you errors about not finding the mariadb apt repos. - There is a new LTS available. MariaDB releases a new LTS version about every year. If you want to make use of the new features or stability improvements then you should update to the latest LTS

Before you upgrade

You should make a backup of your server or databases first. It is unlikely that the upgrade will fail but better have a backup just in case. In some steps you might be asked for your root password. You can get your root credentials using clpctl db:show:master-credentials.

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/

How to upgrade

Here is a quick guide on how to upgrade MariaDB latest 11.8 LTS release. 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 from your current version (e.g. 11.4) to the target version 11.8
    For example: deb [arch=amd64,arm64] https://mirror.mariadb.org/repo/11.8/ubuntu noble main
  4. Run apt update
  5. Install mariadb 11.8 with apt install mariadb-server. This also upgrades mariadb-common and removes old mariadb 10.11 packages still existing after the mariadb-server uninstall.
    ⚠️ If asked about the file 50-server.cnf answer n to not create that file
  6. Start the service with systemctl start mysql
  7. 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.
  8. Run sqlite3 /home/clp/htdocs/app/data/db.sq3 "UPDATE database_server SET version='11.8' WHERE engine = 'MariaDB' AND host='127.0.0.1'" to update the CloudPanel UI to reflect your new version in the database servers list.