MySQL Migration using Native solution
- Aug 26, 2024
- 1 min read
Updated: Aug 28, 2024
In the following post we will be using AWS RDS to migrate from one dabase to another, specially used in case that company doesn't have encryption enabled, wants to test a new updated version or any other scenario for experimentation.

The process is as follows: Using the current Database we enable two things
binlog_format = ROW ****(parameter group chance)
call mysql.rds_set_configuration('binlog retention hours', 72);
Create an snapshot of the current DB
That triggers a crash recovery point in the snapshot, that once restore, it will return values in for crash recovery point
mysql-bin-changelog.000002 123534
Create new Database
In the new database we run:
CALL mysql.rds_set_external_master ('new_db', 3306, 'repl_user', 'password', 'mysql-bin-changelog.000002', 123534, 0);
This creates the connection to the old DB.
Run the following command to start replication and check the status of it
CALL mysql.rds_start_replication;
SHOW REPLICA STATUS;
DO NOT WRITE TO THE NEW DATABASE till you want to complete the switchover: Diagram:





Comments