Downgrading MariaDB
How to downgrade MariaDB Server to a lower release series: backup-based approaches, replication rollback risks, and version-specific incompatibilities for supported releases.
Overview
This page covers the case where a server has been upgraded to a newer major version and needs to go back, for example an upgrade from MariaDB 10.6 to MariaDB 11.8 that has to be rolled back. It documents the problems you can expect with default settings and the approaches that work.
A downgrade succeeds only when you plan for it before you upgrade and avoid features exclusive to the higher version.
Choose Your Scenario
The right approach depends on whether you need to keep data written after the upgrade.
Roll back to the pre-upgrade state, discarding data written since the upgrade
A physical backup taken before the upgrade
Restore the physical backup
Downgrade and keep data written after the upgrade
A logical dump from the upgraded server
Dump and restore
Rolling Back to the Pre-Upgrade State
If the transactions written since the upgrade can be discarded, restoring the physical backup taken before upgrading is the simplest and most reliable option. The raw files are restored as they were, so none of the version incompatibilities described below apply.
This is usually acceptable on staging systems, non-critical applications, and read-mostly workloads.
Downgrading and Keeping Data Written After the Upgrade
If the server has been running on the newer version and that newer data must be preserved, a physical restore might not be an option anymore. Use a logical dump and restore instead.
Before You Begin
If backported features are used with MariaDB Enterprise Server, downgrading after upgrading to a newer maintenance version may not be allowed. For more information, see the release notes for your version of MariaDB Enterprise Server, specifically the Backports section of the What's New page.
See MariaDB Enterprise Server Considerations.
Before attempting any downgrade, ensure the following factors:
Feature Compatibility
The downgrade will not succeed if any features introduced in the higher version are in use, such as new InnoDB table formats, storage engine behaviors, or system table structures.
Common categories of change that may prevent downgrading include:
InnoDB redo log format changes: The format changed in MariaDB 10.8 (MariaDB Enterprise Server 11.4). An older server cannot read a newer redo log.
System table changes: The privilege and status tables in the
mysqlschema change between most major versions.New InnoDB table formats: Tables created or rebuilt in a format the older version does not recognize cannot be opened after the downgrade.
Removed subsystems: A subsystem removed in the newer version, such as the InnoDB change buffer removed in MariaDB 11.0 (MariaDB Enterprise Server 11.4), changes what the older version expects to find on disk.
See Version-Specific Considerations for the cases that apply to currently supported versions.
Configuration Compatibility
If the older version does not support configuration options added or enabled in the current version, downgrading (and replication to a lower version) may fail.
In such circumstances, configuration variables may need to be modified to match the target version's defaults or supported options before proceeding with the downgrade.
Maintenance Releases
Downgrades within the same release series are generally possible, but compatibility should still be verified. Check the release notes for the specific maintenance releases involved, since individual releases occasionally change storage formats or system tables.
Why Major Version Downgrades Break
The main reasons for a major version downgrade failure are:
System table schema changes: As the privilege system improves, the privilege and status tables in the mysql schema change between most major versions.
Format changes on on-disk data: These are less common and generally table-specific, but when they occur the affected tables cannot be opened in earlier versions.
Internal changes to storage engines: InnoDB has introduced redo log formats that earlier versions cannot read. The format written by MariaDB 10.8 (MariaDB Enterprise Server 11.4) and later is not readable by MariaDB 10.6, so a data directory from a newer server cannot simply be started on the older one.
Downgrading Using Replication
A lower-version replica can be attached to a higher-version primary, allowed to catch up, and then promoted. This minimizes downtime, but it is the least predictable of the approaches described here and is not tested by MariaDB.
Why Replication Breaks
The binary log transport itself is not the problem. MariaDB 10.6 and MariaDB 11.8 use the same set of binary log event types, so the replica can read what the primary sends. Replication breaks at the SQL and schema level instead, when the primary sends something the replica has no definition for.
Data types added after the replica's version are the most common cause. For a MariaDB 10.6 replica, these include:
UUID, added in MariaDB 10.7 (MariaDB Enterprise Server 11.4)VECTOR, added in MariaDB 11.7 (MariaDB Enterprise Server 11.8)
If a table on the primary uses one of these, the replica stops with an error such as:
The same applies to DDL, system variables, and SQL syntax introduced after the replica's version. Statement-based replication fails on anything the older parser cannot read.
Requirements
Before starting, confirm all of the following:
No table on the primary uses a data type, table option, or storage engine feature unavailable in the target version.
No application or scheduled job issues SQL that only the higher version understands.
Configuration variables set on the primary exist in the target version.
A verified backup exists. Replication is not a substitute for one.
Process
Take and verify a full backup before making any changes. This is the recovery path if the downgrade fails.
Use
mariadb-dumpto create a full logical backup of your entire database.Additionally, back up the
mysqlschema separately, as this is where the majority of version-specific upgrading changes occur.Store both backups securely and verify their readability before proceeding.
Install MariaDB's target lower version on a separate server or environment. Then, set up the lower-version server as a replica and the current (higher version) server as the primary.
Verify replication is working. On the lower version replica, run:
Let the replica run under production load long enough to encounter the application's full range of statements. A replica that is merely caught up has not been proven compatible; it has only proven that nothing incompatible has happened yet.
Once validation is complete:
Stop writes to the current (higher version) server.
Confirm the replica has applied all remaining events.
Promote the downgraded server to the primary.
Redirect application traffic to the downgraded server.
Restore from Backup (Fallback Method)
If the replication-based method is not possible, the most reliable alternative is to restore from a full backup created in Step 2 of Downgrading Using Replication.
Install a lower version of MariaDB on a clean server.
Launch MariaDB, then restore the backup:
To update system tables for the previous version, run mariadb-upgrade.
Restart MariaDB and check the connectivity of the application.
When used on a clean installation, this method is reliable but involves more downtime than the replica-based approach.
In-Place Downgrade Method
The MariaDB developers have not tested this method, so it is not advised. A lot of things can go wrong. Whenever possible, use the backup-restore or replication-based methods mentioned above.
In general, an in-place downgrade to a previous major version is only allowed if you have not yet executed mariadb-upgrade on the new version.
Note: It is recommended to run mariadb-upgrade after upgrading to ensure security and collation correctness, which limits the available downgrade window.
If you have to attempt an in-place downgrade process, perform the following steps:
Shut down MariaDB cleanly. Ensure:
You use SHUTDOWN command, mariadb-admin shutdown or the operating system official commands, like systemctl stop mariadb.service.
Start the old server binary with --skip-grant-tables to bypass the incompatible privilege tables.
Restore the mysql schema tables to the old definitions using
ALTER TABLE, or drop and recreate them. To find the old definitions, run mariadb-install-db on a temporary data directory, start a temporary server, and use SHOW CREATE TABLE.Execute FLUSH PRIVILEGES to reload the restored privilege tables.
This procedure will not work if the table format has changed in an incompatible manner. In this case the affected tables may not be accessible in the earlier version. See Version-Specific Considerations below.
Version-Specific Considerations
Downgrading to MariaDB 10.6
MariaDB 10.8 introduced a new InnoDB redo log format. MariaDB 10.6 reads only the older format, so it cannot start on a data directory left behind by MariaDB 10.8 or later, including MariaDB 11.4 and MariaDB 11.8. InnoDB reports:
InnoDB Change Buffer
MariaDB 11.0 removed the InnoDB change buffer (MDEV-29694). This does not block a downgrade under default settings: innodb_change_buffering has defaulted to none since MariaDB 10.5.15 and MariaDB 10.6.7 (MDEV-27734), and a server upgrading to MariaDB 11.0 or later empties any change buffer it finds.
The change buffer is only a concern if innodb_change_buffering was explicitly set to a value other than none on the older server.
Downgrading from MariaDB 11.8 to MariaDB 11.4
Both versions are free of the change buffer and share the same InnoDB redo log format, so neither is a factor. Verify system table and configuration compatibility as described above.
However, MariaDB 11.8 introduced the VECTOR data type and vector indexing (MDEV-33410), which does not exist in MariaDB 11.4 or earlier. Any table with a VECTOR column or vector index cannot be opened on MariaDB 11.4; drop or convert those columns/indexes before downgrading.
MariaDB Enterprise Server Considerations
MariaDB Enterprise Server may include backported features, which are functionalities from newer versions added to a previous maintenance release. Downgrading to a version without a backport (even within the same release series) might not be feasible if you use a backported feature.
Before downgrading Enterprise Server:
Review the Backports section of the relevant What's New page for your current version.
Check for enabled backported features.
See Also
This page is licensed: CC BY-SA / Gnu FDL
Last updated
Was this helpful?

