You may encounter technical challenges during a server upgrade or downgrade, and it is beyond the function of MySQL Enterprise Backup, as a backup tool, to ensure a successful server upgrade or downgrade. Users interested in the topic are advised to consult the MySQL server manual, especially the Upgrading MySQL and Downgrading MySQL sections, and pay careful attention to the requirements and restrictions discussed there.
You can facilitate a server upgrade or downgrade by using MySQL Enterprise Backup to make a backup of your server data, restore it to a data directory, and start a different version of MySQL server on the old data. Here are a number of things that users should pay attention to when restoring a backup with a database upgrade or downgrade:
Restoring a database to an older MySQL version (i.e., server downgrading) should only be performed when the original and the final server versions are in the same release series . Downgrading to a lower series (for example, from 8.0.11 to 5.7.21) might cause server crashes or data corruption.Important
Currently, server downgrade, even within the same release series, is not supported, as per the policy described in Downgrading MySQL
Back up the data on the older server.
Using the same version of MySQL Enterprise Backup with which the backup was taken, restore the data to the directory you plan to use as the newer server's data directory by running a
copy-back-and-apply-logoperation on the backup.
Restart the older server, using the intended data directory for the newer server as its own data directory. With this step, the older server prepares the data for an upgrade by performing some clean-up steps on the data, similar to what the server would do during a crash recovery.
Perform a slow shutdown for the older server by, issuing the
SET GLOBAL innodb_fast_shutdown=0statement and then shutting the server down. This will ensure that all dirty pages are flushed, and hence there will be no redo log processing for the newer server.
Install the newer server.
Start the newer server.
Perform the upgrade steps as documented in the MySQL reference manual on the restored data. For MySQL 8.0.15 and earlier: Make sure the mysql_upgrade that comes with your newer server is applied (there is no need to run mysql_upgrade after upgrading to MySQL 8.0.16 or later).
After performing these steps, check your data to make sure that your restore is successful.