How to downgrade MariaDB or MySQL

On this page we have summarised information about downgrading a MariaDB/MySQL database. We do not cover migrating from MySQL to MariaDB or vice versa. For migrations (sidegrade) please look here: MySQL - MariaDB migration and here: Migration between MySQL/Percona Server and MariaDB.

The downgrade process tends to be neglected because nobody really wants to do it. So we are in swampy territory here. Unforeseen situations can occur very easily and good preparation is essential.

I can think of the following possible options for the downgrade:

  • Restore the backup that was made BEFORE the upgrade began.
  • Binary inplace downgrade (which is NOT supported in many cases).
  • Dump (mariadb-dump/mysqldump) of the upgraded database and restore (mariadb/mysql) to the old version (logical backup/restore).
  • Master/slave replication (with Statement Based Replication (SBR) or Row Based Replication (RBR)) and fallback to the slave with the old version.
  • Partial Backup/Restore with mariadb-backup/xtrabackup (Transportable Tablespace (TTS) method).

All these options have their advantages and disadvantages and must be carefully tested in advance.

Downgrade MariaDB

Downgrading MariaDB is not officially supported between major versions.

First sentence in Downgrading between Major Versions of MariaDB by MariaDB Foundation.

FromDual says: But it usually works. Downgrading from minor versions practically always works.

Physical (in-place) downgrade NOT possible:

From versionTo version
11.0 or laterto 10.4 or earlier: NOT possible
11.0 or laterto 10.5 or later: Possible with restrictions
10.8 or laterunclear description
10.5to 10.4: With restrictions
10.5to 10.3: With restrictions or problems
10.3to 10.2: With restrictions

In addition:

Downgrade MySQL

Downgrade from MySQL 8.0 to MySQL 5.7, or from a MySQL 8.0 release to a previous MySQL 8.0 release, is not supported. The only supported alternative is to restore a backup taken before upgrading. It is therefore imperative that you back up your data before starting the upgrade process.

First and only sentence in Downgrading MySQL (8.0) by Oracle Corp.