8 hours ago8 hr Upgrading to MariaDB 11 brings improved query performance, updated storage engine optimizations, and long-term security support for Control Web Panel (CWP) servers running EL8 or EL9 or EL10. This guide walks through upgrading from MariaDB 10.x to MariaDB 11.8 LTS (or 11.4 LTS) safely on AlmaLinux 8/9/10, Rocky Linux 8/9/10,, and CentOS Stream 8/9/10,.Important: Stopping and removing MariaDB causes database downtime for all hosted websites and CWP services until the upgrade finishes. Downgrading after a major version upgrade is not supported without restoring from a logical SQL dump, so always back up your databases first.Prerequisites: Back Up Databases and ConfigurationBefore making any changes, dump all databases and back up your current my.cnf file:BACKUP_DIR="/home/mysql_upgrade-$(date +%F)" && mkdir -p "$BACKUP_DIR" && cp /etc/my.cnf "$BACKUP_DIR/my.cnf.bak" && cp /etc/my.cnf /etc/my.cnf.bak && for db in $(mysql -N -e "SHOW DATABASES;" | grep -Ev '^(information_schema|performance_schema|sys)$'); do mysqldump --single-transaction --quick --lock-tables=false "$db" | gzip > "$BACKUP_DIR/${db}.sql.gz"; done Verify that the backup file was created and is not empty:ls -lh /home/mysql_upgrade*Step 1: Stop and Remove Existing MariaDB Packages (base OS packages)Stop the database service, disable the default OS AppStream MariaDB module to prevent repository conflicts, and remove the old MariaDB RPM packages. This removes only the binaries and leaves your database files in /var/lib/mysql intact.Bashsystemctl stop mariadb mysql mysqld 2>/dev/null systemctl disable mariadb 2>/dev/null dnf module disable mariadb -y rpm -e --nodeps $(rpm -qa | grep -iE '^(mariadb|mysql|galera)') 2>/dev/nullCheck that no old MariaDB packages remain:rpm -qa | grep -i mariadbIf any conflicting galera or MariaDB-* package is still listed, remove it with rpm -e --nodeps <package_name>.Step 2: Add the Official MariaDB 11 Repository and InstallBack up any existing MariaDB repository files in /etc/yum.repos.d/:mv /etc/yum.repos.d/mariadb.repo /etc/yum.repos.d/mariadb.repo.bak 2>/dev/null mv /etc/yum.repos.d/MariaDB.repo /etc/yum.repos.d/MariaDB.repo.bak 2>/dev/nullCreate a new repository file:nano /etc/yum.repos.d/mariadb.repoPaste the following configuration and save the file. If you prefer the 11.4 LTS branch, replace 11.8 with 11.4.[mariadb] name = MariaDB baseurl = https://rpm.mariadb.org/11.8/rhel/$releasever/$basearch module_hotfixes = 1 gpgkey = https://rpm.mariadb.org/RPM-GPG-KEY-MariaDB gpgcheck = 1Clear the DNF cache and install MariaDB 11 along with the required CWP dependencies:dnf clean all dnf install MariaDB-server MariaDB-client MariaDB-devel MariaDB-shared net-snmp perl-DBD-MySQL -y dnf update -yConfirm the new packages are installed:rpm -qa | grep -i MariaDBStep 3: Restore my.cnf and Start MariaDBRestore your original configuration file:rm -f /etc/my.cnf cp /etc/my.cnf.bak /etc/my.cnfReview /etc/my.cnf and comment out any directives removed in MariaDB 11 (such as innodb_defragment* or deprecated query_cache_* options) if they are present.Enable MariaDB on boot and start the service:systemctl enable mariadb systemctl start mariadbCheck the service status:systemctl status mariadbIf MariaDB fails to start, inspect the logs for unsupported configuration options:journalctl -u mariadb -n 50 --no-pagerStep 4: Upgrade System Tables and VerifyRun mariadb-upgrade to update system tables and check compatibility across all databases:mariadb-upgrade --forceIf root password authentication is not configured in /root/.my.cnf, run:mariadb-upgrade --user=root --password --forceRestart MariaDB and confirm the installed version:systemctl restart mariadb mariadb -VThe output should display 11.8.x-MariaDB (or 11.4.x-MariaDB), confirming the upgrade is complete.Your CWP server on EL8/EL9/EL10 is now running MariaDB 11. Test your hosted websites and CWP dashboard to verify normal database connectivity before removing your backup dump.
Create an account or sign in to comment