Server Upgrade Checks with MySQL Shell

Over the last few years, I have become quite smitten with MySQL Shell. For those who may not be familiar with MySQL Shell, it is a new(ish) command line interface (CLI) for connecting to and managing MySQL instances. During a recent episode of Inside MySQL: Sakila Speaks, Fred and I talked to Miguel Araujo about many of the helpful (and lesser known) features of MySQL Shell. This post is the fifth in a series about these “hidden gem” features.
The Problem
Compatibility concerns can often be the driving force behind deciding not to upgrade to a newer version of MySQL. Wouldn’t it be helpful if there was a tool that could look at our existing database and check if there are any issues with updating to a newer version? MySQL Shell has you covered.
The Solution
The global util
object in MySQL Shell has a method named checkForServerUpgrade()
that can check a current database and find any potential issue with upgrading to a newer version of MySQL.
The most straightforward syntax to check for upgrade compatability issues is the following command:
When this command is run, it will complete an upgrade check on the database instance MySQL Shell is connected to against the version of MySQL Shell being used to run the check (in my case, I am using version 8.4). In my case, I am checking a database running MySQL 8.0.37 for compatibility issues upgrading to MySQL 8.4. Here are the results of this check:
These results show no show-stopping compatibility issues, and most of the output involves details about updates to system variables. Given these results, upgrading to MySQL 8.4 should be possible without changing the existing database.
Check out the documentation for more information on what is checked when we run util.checkForServerUpgrade()
.
Checking Other Systems
With MySQL Shell, we can check other systems when running util.checkForServerUpgrade()
. The syntax for connecting to another system to run the check resembles the following command:
Method Options
There are other options available to check server compatibility. These options include:
targetVersion
- The MySQl version to which the upgrade will be checked.include
- A comma separated list of checks to be run.exclude
- A comma delimited list of checks to exclude.
For more information on the available options, run the command:
Wrap-Up
Identifying compatibility issues when upgrading to a newer version of MySQL can be daunting and time-consuming. Addressing those issues can be even more daunting and time-consuming. Using util.checkForServerUpgrade()
in MySQL Shell, we are able to quickly identify any issues and verify that they have been addressed before moving forward with a system upgrade.
Photo by Online Marketing on Unsplash
Related Entries
- Running External Scripts in MySQL Shell
- Executing System Commands in MySQL Shell
- Getting Help in MySQL Shell
- Sandboxes in MySQL Shell
- MySQL Connection Status with MySQL Shell
- Managing MySQL Shell Configuration Options
- Advanced Data Dump with MySQL Shell
- Advanced Data Load with MySQL Shell
- MySQL Shell CLI Integration
- MySQL Shell Table Export Utility
- Copy Data Directly To A MySQL Instance With MySQL Shell
- Create an InnoDB Replica Set With MySQL Shell
- Using MySQL Shell to Get MySQL Diagnostic Information
- Customizing The MySQL Shell Prompt
- Extending MySQL Shell with Startup Scripts
- Extending MySQL Shell with Plugins
- Doing a 'Incremental' Dump With MySQL Shell