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:
- Stop the service with
systemctl stop mysql
- Removed the old mariadb with
apt remove mariadb-server
- Change the file
/etc/apt/sources.list.d/mariadb.list
to say11.4
instead of10.11
- Run
apt update
- Install mariadb 11.4 with
apt install mariadb-server
. This also upgradesmariadb-common
and removes old mariadb 10.11 packages still existing after the mariadb-server uninstall. - If asked about the file
50-server.cnf
answern
to not create that file - Start the service with
systemctl start mysql
- Run the upgrade command with
mariadb-upgrade -u root -p -h 127.0.0.1
. Here you will need your root password obtained from theclpctl db:show:master-credentials
command. - 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.