Migrating MySQL 8.0.20 database to AWS Aurora - mysql

I was trying to use the AWS RDS Proxy service and realized that the only compatible versions with the service are AWS Aurora.
The current database I have is a MySQL database using MySQL version 8.0.20. AWS Aurora is MySQL compatible but only with version 5.6 and 5.7. I am not overly familiar with these versions and how different it would be to version 8.0.20.
Has anyone gone through the process of converting a MySQL database to Aurora? I know there are docs on the subject out there but they deal with version 5.6 or 5.7, has anyone done it for later versions?
I have all the MySQL code in SQL files along with the stored procedures so the database creation can be automated to an extent, it would just be if anyone has ran into issues doing it/found a better way than running multiple SQL files to transfer over data.
If you have gone through the process are there major differences between MySQL and Aurora in terms of running stored procedures etc?

MySQL 8 is now supported in AWS Aurora: https://aws.amazon.com/blogs/database/amazon-aurora-mysql-3-with-mysql-8-0-compatibility-is-now-generally-available/
They include the migration path in particular through a read replica promotion or full snapshot restore from rds into aurora.

Aurora 3.01.00 is the first public GA version of Aurora MySQL 8 released 2021-11-18 -- https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/AuroraMySQL.Updates.3010.html
I've written a full tutorial of the upgrade process including the multiple options for pre-checks to ensure maximum compatibility at https://github.com/ronaldbradford/aws-tutorial/blob/main/rds/mysql-aurora-major-upgrade.md

Related

Match up the version of MySQL that AWS Aurora uses to a MySQL Docker image

I want to spin up a MySQL Docker container with the version of MySQL that matches closest to the AWS RDS version "5.7.mysql_aurora.2.08.1".
Would that be the MySQL image with the tag 5.7.20?
Is there someplace to look something like this up?
According to the Aurora documentation:
There isn't a one-to-one correspondence between community MySQL 5.6 or 5.7 versions and the Aurora MySQL 1.x and 2.x versions. To check which bug fixes and new features are in a particular Aurora MySQL release, see Database engine updates for Amazon Aurora MySQL 2.0 and Database engine updates for Amazon Aurora MySQL 1.1. For a chronological list of new features and releases, see Document history. To check the minimum version required for a security-related fix, see Security vulnerabilities fixed in Amazon Aurora MySQL.
I think you should feel comfortable using the latest mysql:5.7 docker image. This ensures your client has all the security fixes.

is there an option to configure replication salve of MYSQL version 5.7 to master Azure Database for MySQL of version 5.6?

i have Azure Database for MySQL of version 5.6 in AZURE and i read somewhere that MYSQL support in slave in higher version (5.7) than the master (5.6) but i did not found any reference to it in AZURE doc and did not found any option to configure version when creating replica via AZURE portal , is this possible to configure replica in higher version specifically salve of MYSQL version 5.7 to MYSQL 5.6 master in Azure Database for MySQL ?
Azure Database for MySQL support version 5.6 and 5.7.
You can get all the supported versions and release notes from this document:
Supported Azure Database for MySQL server versions:
MySQL Version 5.6: Refer to the MySQL release notes to learn
more about improvements and fixes in this version.
MySQL Version 5.7: Refer to the MySQL release notes to learn
more about improvements and fixes in this version.
In Azure Database for MySQL,Using dump and restore help you upgrade across MySQL versions. For more details, please see: Common uses for dump and restore
To avoid any compatibility issues, ensure the same version of MySQL is used on the source and destination systems when dumping databases. For example, if your existing MySQL server is version 5.7, then you should migrate to Azure Database for MySQL configured to run version 5.7.
If you don't need to care about the compatibility issues, you can try to use this way to
downgrade and configure the version 5.7 to 5.6.
Hope this helps.

Is it possible to downgrade a AWS RDS from mysql 5.7 to lower version (say 5.6)

This is something i need to figure out, my company runs a number of prod RDS on AWS. Some of the mysql RDS run with 5.7 , i need to downgrade the mysql to 5.6 or 5.5 . Is this functionality provided by AWS.
Scenario: A mysql server already up and running with mysql version 5.7, Downgrade this to 5.6
-> If this is possible then what are the possible ways ?
-> How to do this ?
This is not something that AWS provides out of the box, however it can be solved with below 2 approaches depending on your database size and downtime that you can accept.
It might worth considering fixing application compatibility instead of downgrading DB which is more risky operation.
1. Dump, restore and switch method
Dump your currently running database with mysqldump utility. Start a new RDS instance with downgraded engine, load your dumped data into it. Switch your application to use RDS instance with downgraded engine.
2. Dump, restore, replicate & switch method
Dump your currently running database with mysqldump utility. Start a new RDS instance with downgraded MySQL engine, load your dumped data into it.
Set the new, downgraded DB instance as read replica of your old DB instance using mysql.rds_set_external_master and then start replication using mysql.rds_start_replication. Stop writes to your original DB, once the read replica catches up (you must monitor replication lag), run mysql.rds_reset_external_master which will promote your downgraded instance and turn off replication. Point your application to the downgraded RDS DB instance.
Method 2 will shorten your downtime to minimum, but is a bit more complex to execute. Here is a command reference to get familiar with to help you succeed: MySQL on Amazon RDS SQL Reference
You will find a great amount of examples in RDS documentation also - Importing and Exporting Data From a MySQL DB Instance:

AWS - Creating Read Replica of a Read Replica

We are migrating our MySql instance from version 5.5 in US to 5.6 in Sydney.
To reduce downtime I want to do following:
Create Readonly Replica in US
Upgrade it to 5.6
Enable automated Backup as it's required to replicate the instance
PROBLEM: When I'm trying to create a replica of a replica(selecting Sydney as destination region) I get this: "The source DB instance specified needs to be non read replica"
If I understand this http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_ReadRepl.html correctly it should be perfectly fine for me to create a replica of a replica, however I'm running out of ideas why it doesn't let me... Should I make it non-readonly?
UPDATE: It looks like you can create a Replica(5.6) of a Read Replica(5.6) in the same region, however I still have no luck creating a readReplica from a readReplica in another region.
I think you are missing the step of Promoting the Read Replica to fully functional stand-alone RDS instance.
Once you are through this step, you can then enable the Backups and Snapshots.
Excerpt From AWS Blog
Upgrade Support
Today we are enhancing Amazon RDS with the ability to upgrade your
MySQL DB Instances from version 5.5 to the latest release in the 5.6
series that's available on RDS.
To upgrade your existing instances, create a new Read Replica, upgrade it to MySQL 5.6, and once it has caught up to your existing
master, promote it to be the new master. You can initiate and
monitor each of these steps from the AWS Management Console. Refer to
the Upgrading from MySQL 5.5 to MySQL 5.6 section of the Amazon RDS
User Guide to learn more.
References : MySQL 5.5 to MySQL 5.6 Upgrade Support for Amazon RDS

How do you migrate Amazon RDS from MySQL 5.1 to MySQL 5.5?

RDS supports MySQL 5.5 and offers a lot of automated feature such as scaling up, expanding disk space, and upgrading the minor version of the database (e.g., from 5.1.49 to 5.1.50). However, is there a way to upgrade from 5.1.x to 5.5, either through the command line tools or the web GUI?
Good news, everyone! Amazon RDS now supports point-and-click upgrade from MySQL 5.1 to 5.5
The RDS FAQ says:
Currently, a direct upgrade from MySQL 5.1 to MySQL 5.5 is not supported.
so you'll have to do it the more traditional way.
For example a simplistic approach would be to start a 5.5 RDS instance and pipe the 5.1 database into it like this:
mysqldump -h mysql5.1.database.host database_name|mysql -h mysql5.5.database.host
then switch to using the 5.5 instance.
Of course, this would be slow for a large database and you will need to avoid writes to the source database during the transition.
Migrating from 5.1 to 5.5 is now available via the AWS Management Console.
I don't know when it was added, but it must've changed recently.