Information on how to downgrade MariaDB Server to a previous version, noting that it is generally unsupported and requires restoring from a logical dump.
Downgrading MariaDB is not officially supported between major versions.
For minor versions, upgrade is supported to an earlier version as we do not change the storage format after and very rarely during (it has to be a very critical bug to require such a change). There are a few very rare cases when incompatible changes happen on a GA version, for example fixed a file format incompatibility bug that prevents a downgrade to earlier releases. After this has not happened in a GA release.
The main reason why downgrades between major versions do not work are:
Changes in the privilege/status tables in the mysql schema. These changes happen between most major versions as we are continuously improving the privilege system.
Changes that affect how data is stored on disk. This happens more rarely and is usually table specific. For example, if one has used on a table in , that table cannot be opened in .
Between major releases there are often substantial changes, even if none of the new features are used. For example, both and introduce new versions of the redo log.
The only reliable way to downgrade is to made before upgrading, and start the old version of MariaDB. At least one should take a backup of the schema as most upgrade changes happens in this directory. This may be of help if one needs to downgrade to an earlier MariaDB version. More about this later.
Some people have reported successfully downgrading, but there are many possible things that can go wrong, and downgrading between two major versions is not tested in any way by the MariaDB developers.
In general, one can downgrade a major version to an earlier version if one has not yet run on the new version. Note however that it's recommended that one always uses after upgrading to a new major version as otherwise some security features in the new server may not work and tables that have indexes using a character collation that has changed may not work properly.
Assuming one must downgrade to an earlier major version, here is a list of things one has to do:
MariaDB must be shut down cleanly. This means that:
One should ensure that .
One uses the command, or the operating system official commands, like .
Start the old server with .
The cases when the above will not work are when the table format has changed in an incompatible manner. In this case the affected tables may not be usable in the earlier version.
The following is an incomplete list of when one will not be able to use a table in an earlier major version:
or later
A downgrade to or earlier is not possible, because removed the InnoDB change buffer.
A downgrade to or later is only possible if (the default starting with ).
This page is licensed: CC BY-SA / Gnu FDL
Use ALTER TABLE to restore the mysql schema tables to their original definition or drop and recreate the mysql tables. One can find the old definition by using mariadb-install-db to create a separate temporary data directory. Starting the MariaDB server on the temporary directory will allow you to use SHOW CREATE TABLE to find the old definition.
Execute FLUSH PRIVILEGES to reload the old tables.
The InnoDB redo log file ib_logfile0 would have to be replaced with a logically equivalent file, or the shutdown LSN has to be written to the FIL_PAGE_FILE_FLUSH_LSN field in the system tablespace (see MDEV-27199), or the data may be accessed read-only when using .
→
The InnoDB redo log file ib_logfile0 has to be deleted between a clean shutdown of the newer version and a startup of the older version. This is not recommended.
→
Any InnoDB table where one has used ALTER TABLE ALGORITHM=INSTANT DROP COLUMN while innodb_instant_alter_column_allowed=add_drop_reorder
Any InnoDB table that was created or rebuilt while innodb_checksum_algorithm=full_crc32
In , the MariaDB mysql.user table was replaced by which may cause problems if ones wants to downgrade to 10.3.
→
Any InnoDB table where one has used ALTER TABLE…ADD COLUMN (unless innodb_instant_alter_column_allowed=never).
A prior shutdown with innodb_fast_shutdown=0 will be needed in order to empty the undo logs whose format changed in MDEV-12288, and even then, you might need to set innodb_force_recovery=3.