Is it possible to downgrade MariaDB on HestiaCP?

Hello,

I’m running HestiaCP on a VPS (Debian 11) and currently have MariaDB 11.4.8 installed.
In this version, the legacy utf8 character set is no longer available only utf8mb4 is supported. Unfortunately, I have an older application that specifically requires the 3-byte utf8 charset, so utf8mb4 is not an option for me.
Is there a safe way to downgrade MariaDB (for example, to version 10.5) within a HestiaCP-managed system, without breaking the control panel or losing databases?
If so, could anyone provide the recommended steps or best practices?
Thank you in advance for any guidance.

1 Like

I would not risk a downgrade. The ultimate answer is to either fix or abandon that outadated application. In the meantime, have you considered using old_mode?

2 Likes

You can test it like this, first you should backup all your sql databases with mysqldump. Then you could remove the version 11.4.8, adapt the repo to 10.5 for example and then reinstall the server. If it complains you can completely remove anything inside /var/lib/mysql/
If you do this you need to run mysql_install_db to set up all default info again and then do a mysql_secure_installation and restore all existing databases.

As you see its a little bit tricky but can be done if this is really needed.

Hi, thanks for the tip. Unfortunately, old_mod doesn’t work with my application, so I need to downgrade. How can I manage the MariaDB version installation in HestiaCP, or choose the specific version I want to install?

MariaDB is not designed for downgrading between major versions, and downgrading between two major versions is not tested in any way by the MariaDB developers. Several HestiaCP users have reported problems after downgrades, including GUI displaying incorrect data, connection failures, and phpMyAdmin access issues.

The Safest Approach: Backup and Restore Method

Here’s the recommended procedure if you absolutely need to proceed:

1. Complete Backup First

Create full database backup

mysqldump --all-databases --routines --triggers --events --single-transaction > full_backup_$(date +%Y%m%d).sql

Also backup HestiaCP configuration

cp -r /usr/local/hestia/data/users/ ~/hestia_users_backup/

cp /usr/local/hestia/conf/mysql.conf ~/mysql_conf_backup

2. Stop Services

systemctl stop hestia

systemctl stop mariadb

3. Remove MariaDB 11.4

apt remove --purge mariadb-server mariadb-client mariadb-common

apt autoremove

rm -rf /var/lib/mysql/*

4. Install MariaDB 10.5

Edit MariaDB repository

nano /etc/apt/sources.list.d/mariadb.list

Change to: deb [arch=amd64] https://archive.mariadb.org/mariadb-10.5/repo/debian/ bullseye main

apt update

apt install mariadb-server mariadb-client

5. Restore Data

systemctl start mariadb

mysql_secure_installation

mysql < full_backup_$(date +%Y%m%d).sql

6. Reconfigure HestiaCP

Update HestiaCP database settings

/usr/local/hestia/bin/v-update-sys-hestia-all

systemctl start hestia

Alternative Solutions (Recommended)

Before attempting this risky downgrade, consider these alternatives:

Option 1: Application Compatibility Layer

  • Modify your application’s database connection to use utf8mb3 explicitly instead of utf8
  • In MariaDB 10.6+, you can set the old_mode system variable to make utf8 imply utf8mb4

Option 2: Use a Different Server

  • Set up a separate server with MariaDB 10.5 for this specific application
  • Keep your main server on 11.4 for other applications

Option 3: Application Updates

  • Consider updating the legacy application to support utf8mb4
  • Many applications can be modified to work with the newer charset

Critical Warnings

  1. Data Loss Risk : Users have reported needing to recreate database users and restore phpMyAdmin/Roundcube configurations after downgrades
  2. HestiaCP Integration : The control panel may not properly recognize the downgraded version
  3. No Rollback : Once you start this process, rolling back becomes complex

My Recommendation

Given the high risk involved, I’d strongly recommend exploring application-level solutions first. If the legacy application absolutely cannot be modified, consider running it on a separate server with MariaDB 10.5 rather than risking your entire HestiaCP installation.

If you do proceed with the downgrade, ensure you have:

  • Complete system backups
  • A tested restore procedure
  • Downtime window for troubleshooting
  • Alternative hosting ready if things go wrong
  • Please do not forget, MariaDB 10.5 is EOL and does not receive any security fixes anymore
1 Like