Upgrade MariaDB from 10.6 LTS to 11.8 LTS on FreeBSD
Here’s my process to upgrade MariaDB from 10.6 LTS to 11.8 LTS on FreeBSD. It’s very straighforward. I’ll be adding in some safety checks along the way, like DB and config file backups, to help ensure this upgrade goes smoothly.
First, review the official upgrade notes. There have been some changes to be aware of, including my.cnf option deprecations that could throw errors after the upgrade.
Upgrade process
Launch a root console.
Backup all databases:
mysqldump --all-databases > mysql-upgrade-backup-$(date +%Y%m%d).sql
Back up all config files:
tar -cvzf /root/mysql_config_backup_$(date +%Y%m%d).tar.gz /usr/local/etc/mysql
Stop the MariaDB server:
service mysql-server stop
Remove the old server packages:
pkg delete mariadb106-server mariadb106-client
Install the new version (this also installs the -client package):
pkg install mariadb118-server
Run the post-install upgrade:
mariadb-upgrade
Start the MariaDB server:
service mysql-server start
Fire up your applications and validate the systems are working as intended!