Migrating From MariaDB RDS to MariaDB Cloud
Guide for migrating from MariaDB RDS to MariaDB Cloud using AWS Database Migration Service (DMS).
This guide covers migrating from a self-managed or AWS MariaDB RDS instance to MariaDB Cloud using AWS Database Migration Service (DMS), utilizing binary log streaming for Change Data Capture (CDC) to enable a near-zero downtime cutover.
Phase 1: Preparing Your Source and Target Environments
DMS reads changes from MariaDB using binary log replication. These settings must be in place before creating DMS endpoints or starting any task.
Source AWS MariaDB RDS Configuration
Enable automated backups: Set Backup Retention Period to at least 1 day.
Create a custom parameter group: Apply the following parameters to ensure DMS can read row-level changes:
binlog_format = ROWbinlog_row_image = FULLbinlog_checksum = NONE

Apply and reboot: Associate the custom parameter group with your RDS instance and reboot to finalize the
ROWmode.Set log retention: Provide a buffer for DMS to read the continuous logs. Run this command:
CALL mysql.rds_set_configuration('binlog retention hours', 24);Verify that all of the following variables are set, by running the following statements:
MariaDB [(none)]> SHOW VARIABLES LIKE 'net%';
+-------------------+-------+
| Variable_name | Value |
+-------------------+-------+
| net_buffer_length | 16384 |
| net_read_timeout | 30 |
| net_retry_count | 10 |
| net_write_timeout | 60 |
+-------------------+-------+
MariaDB [(none)]> SHOW VARIABLES LIKE 'binlog_format';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| binlog_format | ROW |
+---------------+-------+MariaDB Cloud Target Configuration
Create database: Log into MariaDB Cloud and run
CREATE DATABASE db_name;.Create user (optional): Use the default user to create additional users with privileges (for instance, users in RDS,
dms_adminetc.), setting the Allowed Host to%or to the specific IP of your DMS instance.Verify settings: Issue the same
SHOW VARIABLESstatements as in the previous step.Enable connectivity: Open the MariaDB Cloud allowlist during setup, narrow it to the NAT Gateway EIP (or DMS Public IP) before go-live.

Phase 2: Provisioning the AWS DMS Networking and Compute
The replication instance is the compute resource that handles the data migration.
Instance type: Using a Provisioned instance is highly recommended for static IP stability.
VPC architecture: Deploy resources within private subnets for enhanced security, utilizing a NAT Gateway to establish the required outbound internet connection to MariaDB Cloud.
Public accessibility: Select Publicly Accessible: Yes if your traffic is routing over the internet. Note the allocated Public IP and add it to your MariaDB Cloud allowlist if you are not using an open
0.0.0.0/0rule.

Test Connections: Ensure both endpoints return a Successful status.

Phase 3: Migrating Schema Definitions and Secondary Objects
AWS DMS only migrates table data and basic primary keys. It does not migrate secondary objects such as views, stored procedures, or triggers.
Export metadata from RDS source: Use mariadb-dump from your terminal to grab all schema objects except the table data. Run this command:
Phase 4: Configuring Migration Endpoints and Sync Tasks
Before creating endpoints, establish secure CA certificate trust between AWS DMS and your database servers.
Source Endpoint (RDS)
Download the Global Bundle or Regional CA from the AWS RDS connection information section.

In the DMS Console, go to Certificates > Import Certificate. Upload the
global-bundle.pemfile and rename it tords-source-ca.In the Source Endpoint settings, select SSL mode:
verify-caand choose therds-source-cacertificate. Point to your RDS endpoint using the MariaDB user.

Target Endpoint (MariaDB Cloud)
Download the MariaDB Cloud CA Certificate from your MariaDB Cloud portal (found in the Security or Connect tab).

Import this into the DMS Console as MariaDB Cloud-target-ca.
Create the Target Endpoint, select SSL mode:
verify-full, and point it to the MariaDB Cloud endpoint on Port3306.

Create the DMS Migration Task
Migration type: Select Migrate existing data and replicate ongoing changes (enables Snapshot + Replica mode).
Target table preparation mode: Choose Drop tables on target if you want DMS to build the structures, or Do nothing if you precreated the tables.
Stop task after full load completes: Select Don't stop so it transitions into CDC mode automatically.
Include LOB columns in replication: Select Limited LOB mode.
Table Mappings: Add a selection rule with Schema <your Schema Name>, Table name
%, and Action Include.Transformation Rules: Add rules here if you need to rename schemas (for instance, rename
sakilatosakila_prod).Premigration Assessment: Enable this to let AWS check for potential issues (unsupported data types, missing primary keys) before launching.
Phase 5: Live Replication, Target Cutover, and Decommissioning
Executing the Snapshot + Replica: Select Start on create to initiate the Full Load. Watch the Full Load progress bar until it hits 100%. The task status will transition to Load complete, replication ongoing. From this point forward, any
INSERTorUPDATEstatement on the RDS source is replicated to MariaDB Cloud instantaneously.

Post-table migration (views, triggers, and procedures): AWS DMS does not migrate secondary objects. Once DMS shows the load is complete, apply the metadata you exported in Part 3 to your MariaDB Cloud Instance:
Cutover: Identify a low-traffic window, stop the application from writing to the RDS source, and wait for the CDC lag to hit zero. Update your connection strings to point to MariaDB Cloud, re-enable your triggers, and finally terminate the DMS task and infrastructure.
Phase 6 (Optional): Reverse Replication
Switch master and slave to make MariaDB Cloud the master.
Establishe MariaDB SkySQL as the primary (master) and AWS RDS as the replica (slave).
Prepare MariaDB Cloud (new master)
Before RDS can follow MariaDB Cloud, the target environment must be configured to allow inbound replication.
Add the AWS RDS Public IP (or NAT Gateway EIP) to the SkySQL Allowlist (Port
3306).Identity: Create a dedicated replication user on MariaDB Cloud (SkySQL):
Checkpoint: Capture the current binary log coordinates to tell RDS where to start:
Configure AWS RDS (new slave): Because RDS is a managed service, standard
CHANGE MASTERstatements are restricted. You must use AWS stored procedures.
Initialize: Clear old migration metadata and point RDS to the SkySQL endpoint using the file and position from step 1:
Activate: Start the replication threads:
Monitoring & verification: The "source of truth" for the health of this link moves from the DMS Console to the database command line.
Status check on RDS: Run
CALL mysql.rds_replica_status\G;to verify connectivity.Success criteria: Ensure
Slave_IO_RunningisYes,Slave_SQL_RunningisYes, andSeconds_Behind_Masteris0.Status check on MariaDB Cloud: Run
SHOW MASTER STATUS\GandSHOW SLAVE STATUS\G(this should return an empty set).
Decommissioning: Once Seconds_Behind_Master remains at 0, the AWS DMS infrastructure is redundant. To eliminate unnecessary costs:
Stop and Delete the AWS DMS Task.
Terminate the DMS Replication Instance.
Delete the NAT Gateway (if no longer required for outbound RDS traffic).
This page is licensed: CC BY-SA / Gnu FDL
Last updated
Was this helpful?

