Upgrade MariaDB from 5.5/10.x/11.x to MariaDB 10.11 LTS, 11.4 LTS, or 11.8 LTS on CentOS 7 and AlmaLinux/Rocky Linux 8, intended for Plesk environments. The script also configures MariaDB so you can run mysqladmin without entering credentials interactively.
It integrates with Plesk to perform backups, run upgrades, and notify Plesk of version changes.
- MariaDB 10.11 LTS
- MariaDB 11.4 LTS
- MariaDB 11.8 LTS
- Root privileges (
rootorsudo). - RHEL-family OS: CentOS 7, AlmaLinux 8, Rocky Linux 8 (RHEL 8 generally also works).
- Plesk installed (the script uses
plesktools and/etc/psa/.psa.shadow). - YUM/DNF package manager (Debian/Ubuntu are not supported).
- Optional full backup of all databases via
mysqldumpto/root/all_databases_pre_maria_upgrade.sql.gz. - Configures MariaDB repositories per upgrade step (e.g.,
http://yum.mariadb.org/10.11/...). - Stops services, removes incompatible packages, installs target packages.
- Runs
mysql_upgradeand applies sensible defaults inserver.cnf(e.g.,max_allowed_packet,open_files_limit, log link). - Notifies Plesk about package changes and enables
unix_socketsomysqladmincan be used without a password. - Writes a log to
/var/log/mariadb-upgrade.log.
The script detects the current version and chooses the correct path automatically.
- From 5.5: 5.5 → 10.0 → 10.5 → 10.6 → 10.11
- From 5.6: 5.6 → 10.0 → 10.1 → 10.2 → 10.5 → 10.6 → 10.11
- From 10.0: 10.0 → 10.1 → 10.2 → 10.5 → 10.6 → 10.11
- From 10.1: 10.1 → 10.2 → 10.5 → 10.6 → 10.11
- From 10.2: 10.2 → 10.5 → 10.6 → 10.11
- From 10.3–10.4: 10.x → 10.5 → 10.6 → 10.11
- From 10.5: 10.5 → 10.6 → 10.11
- From 10.6–10.10: 10.x → 10.11
- From 5.5: 5.5 → 10.0 → 10.5 → 10.6 → 10.11 → 11.4
- From 5.6: 5.6 → 10.0 → 10.1 → 10.2 → 10.5 → 10.6 → 10.11 → 11.4
- From 10.x: (first upgrade to 10.11) → 11.4
- From 11.0–11.3: 11.x → 11.4
- From 5.5: 5.5 → 10.0 → 10.5 → 10.6 → 10.11 → 11.4 → 11.8
- From 5.6: 5.6 → 10.0 → 10.1 → 10.2 → 10.5 → 10.6 → 10.11 → 11.4 → 11.8
- From 10.x: (first upgrade to 10.11) → 11.4 → 11.8
- From 11.0–11.3: 11.x → 11.4 → 11.8
- From 11.4: 11.4 → 11.8
- From 11.5–11.7: 11.x → 11.8
Run the script as root:
chmod +x mariadb-upgrade.sh
./mariadb-upgrade.sh
The script will prompt you to:
- Choose whether to back up databases (recommended)
- Select a target version (10.11, 11.4, or 11.8)
- Confirm the upgrade
- Designed for Plesk installations; without Plesk some steps (e.g., backup/user plugins) do not apply.
- Only YUM/DNF-based distributions are supported (no Debian/Ubuntu).
- The script updates
/etc/yum.repos.d/mariadb.repoand uses version-pinned repositories for each upgrade step.