Upgrading Between Major MariaDB Versions
Complete MariaDB upgrade guide. Complete migration reference with version compatibility, backup procedures, and rollback strategies for production use.
MariaDB is designed to allow easy upgrades. You should be able to trivially upgrade from ANY earlier MariaDB version to the latest one (for example .x to .x), usually in a few seconds. This is also mainly true for any MySQL version < 8.0 to and up.
Upgrades are normally easy because:
All MariaDB table data files are backward compatible
The MariaDB connection protocol is backward compatible. You don't normally need to upgrade any of your old clients to be able to connect to a newer MariaDB version.
The MariaDB replica can be of any newer version than the primary.
MariaDB Corporation regularly runs tests to check that one can upgrade from to the latest MariaDB version without any trouble. All older versions should work too (as long as the storage engines you were using are still around).
Note that if you are using , you have to follow the !
Galera Cluster Users (Upgrading to 12.3+): You must manually install the mariadb-server-galera (or MariaDB-server-galera) package during the upgrade. Because the automatic dependency has been removed, a standard upgrade will not pull in the necessary cluster management components, which may prevent your cluster from bootstrapping.
Go through the individual version upgrade notes (listed below) to look for any major changes or configuration options that have changed.
Ensure that the target MariaDB version supports the storage engines you are using. For example, in 10.5
Note that rpms don't support upgrading between major versions, only minor like 10.4.1 to 10.4.2. If you are using rpms, you should de-install the old MariaDB rpms and install the new MariaDB rpms before running . Note that when installing the new rpms, may be run automatically. There is no problem with running many times.
If you have a , first upgrade one replica and when you have verified that the replica works well, upgrade the rest of the replicas (if any). Then , upgrade the primary, and change the replica to a primary.
If you don't have a primary-replica setup, then , and do the upgrade.
Upgrade MariaDB binaries and libraries, preferably without starting MariaDB.
If the MariaDB server process, was not started as part of the upgrade, start it by executing mariadbd --skip-grant-tables. This may produce some warnings about some system tables not being up to date, but you can ignore these for now as will fix that.
The main work done when upgrading is done by running . The main things it does are:
Updating the system tables in the mysql database to the newest version. This is very quick.
also runs to check if there have been any collation changes between the major versions. This recreates indexes in old tables that are using any of the changed collations. This can take a bit of time if there are a lot of tables or there are many tables which used the changed collation. The last time a collation changed was in MariaDB/MySQL 5.1.23.
Check the for any problems during upgrade. If there are any warnings in the log files, do your best to get rid of them!
The common warnings/errors are:
Using obsolete options. If this is the case, remove them from your .
Check the manual for that have been added since your last MariaDB version.
Test that your application works as before. The main difference from before is that because of optimizer improvements your application should work better than before, but in some rare cases the optimizer may get something wrong. In this case, you can try to use , or to fix the queries.
First, check the to see if you are using configure options that are not supported anymore.
Check the upgrade notices for the MariaDB release that you are upgrading to.
File an issue in the so that we know about the issue and can provide a fix to make upgrades even better.
In the unlikely event something goes wrong, you can try the following:
Remove the InnoDB tables from the mysql data directory. They are:
MariaDB server is not designed for downgrading. That said, in most cases, as long as you haven't run any or statements and you have a of your old mysql database , you should be able to downgrade to your previous version by doing the following:
Do a clean shutdown. For this special case you have to set to 0,before taking down the new MariaDB server, to ensure there are no redo or undo logs that need to be applied on the downgraded server.
Delete the tables in the mysql database (if you didn't use the option --add-drop-table to )
Delete the new MariaDB installation
This page is licensed: CC BY-SA / Gnu FDL