First, ITRex ran a mini-
discovery cycle to assess compatibility issues, specify upgrade requirements, and prepare the database for the overhaul.
Second, we needed to decide on the most appropriate upgrade method. In this regard, AWS offers two approaches to MySQL database migration. The first one—an in-place upgrade—failed to meet the requirements because of a 20-minute downtime, which was excessive for our customer. Furthermore, it wouldn’t allow us to roll back to the previous version swiftly in case of any issues during the upgrade.
With this in mind, ITRex decided to go with the other option—a blue/green deployment. This technique provides a safe database upgrade with near-zero downtime and zero data loss. Besides, it would allow us to revert the upgrade immediately after it was done in an emergency. To perform the MySQL 5.7 to 8.0 upgradе, we took the following steps:
●
Created a replica of the original cluster
●
Set up a staging environment mirroring production, which allowed us to make changes to the database and test the migration on replicas without compromising production data integrity
●
Once the test cluster proved to work with the app, we simply switched over the environments to promote the staging (blue) environment to be the new production environment