{"id":78263,"date":"2026-03-10T11:19:49","date_gmt":"2026-03-10T05:49:49","guid":{"rendered":"https:\/\/www.tothenew.com\/blog\/?p=78263"},"modified":"2026-03-16T15:42:49","modified_gmt":"2026-03-16T10:12:49","slug":"cross-account-rds-migration-using-aws-dms-snapshot-cdc-strategy","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/cross-account-rds-migration-using-aws-dms-snapshot-cdc-strategy\/","title":{"rendered":"Cross-Account RDS Migration Using AWS DMS (Snapshot + CDC Strategy)"},"content":{"rendered":"<p><strong>Migrating databases<\/strong> between <strong>AWS accounts<\/strong> is often necessary for <strong>environment isolation, organizational changes, or setting up security boundaries<\/strong>. Basic migrations can be performed using dumps or replication. However, <strong>production environments<\/strong> need <strong>minimal downtime, consistency guarantees, and controlled cutover procedures.<\/strong><\/p>\n<p>A strong method for migrating databases between accounts is to combine<strong> snapshot-based data transfer with Change Data Capture (CDC) using AWS Database Migration Service<\/strong>. This article outlines a technical setup and provides a step-by-step guide for moving a MySQL database from one AWS account to another Amazon RDS instance. This will use snapshot restore and CDC replication.<\/p>\n<div id=\"attachment_78301\" style=\"width: 729px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-78301\" decoding=\"async\" loading=\"lazy\" class=\" wp-image-78301\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2026\/03\/datarep-Welcome.png\" alt=\"DMS architecture\" width=\"719\" height=\"217\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2026\/03\/datarep-Welcome.png 1000w, \/blog\/wp-ttn-blog\/uploads\/2026\/03\/datarep-Welcome-300x91.png 300w, \/blog\/wp-ttn-blog\/uploads\/2026\/03\/datarep-Welcome-768x232.png 768w, \/blog\/wp-ttn-blog\/uploads\/2026\/03\/datarep-Welcome-624x188.png 624w\" sizes=\"(max-width: 719px) 100vw, 719px\" \/><p id=\"caption-attachment-78301\" class=\"wp-caption-text\">DMS architecture<\/p><\/div>\n<p>The migration workflow includes these main components:<strong> Source database (Account A), Target RDS instance (Account B), Snapshot restore for the initial dataset, and CDC replication through DMS for ongoing changes.<\/strong><\/p>\n<p><strong>Target Account\u2019s RDS<\/strong><br \/>\nAmazon RDS provides a managed relational database where the migrated dataset will reside.<\/p>\n<p><strong>Migration Engine<\/strong><br \/>\nDatabase Migration Service<\/p>\n<p>AWS DMS performs the <strong>continuous replication of changes from the source database to the target RDS instance<\/strong> by reading transaction logs and applying changes in near real time.<\/p>\n<p><strong>Strategy for Migration<br \/>\n<\/strong>Running a full-load migration through DMS is inefficient for large databases and may result in lengthy migration windows. Rather, a hybrid approach is better:<br \/>\nTransfer of baseline datasets using a snapshot(Sharing your snapshot with the target account)<br \/>\nContinuous replication through CDC<br \/>\nThis method allows for almost no downtime cutover while cutting down on migration time.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Phase 1: Transfer of Cross-Account Snapshots<br \/>\n<\/strong>An RDS snapshot is used to transfer the original dataset.<\/p>\n<p><strong>Step 1:- Make a snapshot in the source account.<br \/>\n<\/strong>Make a manual snapshot of the source RDS instance in Account A(Source).<br \/>\nDatabases \u2192 Actions \u2192 RDS Console \u2192 Take Snapshot<\/p>\n<p><strong>Step 2:- Give the target account access to the snapshot<br \/>\n<\/strong>Snapshots need to be explicitly shared between AWS accounts.<\/p>\n<p>Choose the Snapshot.<br \/>\nIn actions, click on share snapshot.<br \/>\nSnapshot \u2192 Actions \u2192 Share Snapshot \u2192 Add Target Account ID \u2192 Share<\/p>\n<p>KMS key needs to be shared with the target account if encryption is enabled on Source RDS.<\/p>\n<div id=\"attachment_78302\" style=\"width: 195px\" class=\"wp-caption alignleft\"><img aria-describedby=\"caption-attachment-78302\" decoding=\"async\" loading=\"lazy\" class=\" wp-image-78302\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2026\/03\/Screenshot-2026-03-10-at-6.31.01\u202fPM.png\" alt=\"Share Snaphot\" width=\"185\" height=\"211\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2026\/03\/Screenshot-2026-03-10-at-6.31.01\u202fPM.png 870w, \/blog\/wp-ttn-blog\/uploads\/2026\/03\/Screenshot-2026-03-10-at-6.31.01\u202fPM-263x300.png 263w, \/blog\/wp-ttn-blog\/uploads\/2026\/03\/Screenshot-2026-03-10-at-6.31.01\u202fPM-768x876.png 768w, \/blog\/wp-ttn-blog\/uploads\/2026\/03\/Screenshot-2026-03-10-at-6.31.01\u202fPM-624x712.png 624w\" sizes=\"(max-width: 185px) 100vw, 185px\" \/><p id=\"caption-attachment-78302\" class=\"wp-caption-text\">Share Snaphot<\/p><\/div>\n<div id=\"attachment_78303\" style=\"width: 462px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-78303\" decoding=\"async\" loading=\"lazy\" class=\" wp-image-78303\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2026\/03\/Screenshot-2026-03-10-at-6.31.09\u202fPM.png\" alt=\"KMS Permission\" width=\"452\" height=\"205\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2026\/03\/Screenshot-2026-03-10-at-6.31.09\u202fPM.png 1788w, \/blog\/wp-ttn-blog\/uploads\/2026\/03\/Screenshot-2026-03-10-at-6.31.09\u202fPM-300x136.png 300w, \/blog\/wp-ttn-blog\/uploads\/2026\/03\/Screenshot-2026-03-10-at-6.31.09\u202fPM-1024x464.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2026\/03\/Screenshot-2026-03-10-at-6.31.09\u202fPM-768x348.png 768w, \/blog\/wp-ttn-blog\/uploads\/2026\/03\/Screenshot-2026-03-10-at-6.31.09\u202fPM-1536x696.png 1536w, \/blog\/wp-ttn-blog\/uploads\/2026\/03\/Screenshot-2026-03-10-at-6.31.09\u202fPM-624x283.png 624w\" sizes=\"(max-width: 452px) 100vw, 452px\" \/><p id=\"caption-attachment-78303\" class=\"wp-caption-text\">KMS Permission<\/p><\/div>\n<p>&nbsp;<\/p>\n<p>Copy the snapshot to the target account in step three.<br \/>\nCopy the shared snapshot in Account B.<\/p>\n<p>RDS \u2192 Snapshots \u2192 Shared with me \u2192 Snapshot copy(use KMS of Target account, by this, the destination account owns a new snapshot)<\/p>\n<p><strong>Phase 2 \u2014 Preparing Source Database for CDC<\/strong><br \/>\nTo enable continuous replication, the source database must expose transaction logs.<br \/>\nFor MySQL-based engines, enable binary logging.<br \/>\nExample parameter configuration:<\/p>\n<ul>\n<li>log_bin = ON<\/li>\n<li>binlog_format = ROW<\/li>\n<li>binlog_row_image = FULL<\/li>\n<li>binlog retention hours = 24-168hrs, This can be set with<br \/>\nCALL mysql.rds_set_configuration(&#8216;binlog retention hours&#8217;, 168);Verify configuration:<\/li>\n<li>SHOW VARIABLES LIKE &#8216;log_bin&#8217;;<\/li>\n<li>SHOW VARIABLES LIKE &#8216;binlog_format&#8217;;<br \/>\nTake Current Binlog file position with below query this will be used on CDC task creation<\/li>\n<li>SHOW MASTER STATUS;\n<ul>\n<li>Output Ex:-\n<p><div id=\"attachment_78304\" style=\"width: 351px\" class=\"wp-caption alignnone\"><img aria-describedby=\"caption-attachment-78304\" decoding=\"async\" loading=\"lazy\" class=\" wp-image-78304\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2026\/03\/Screenshot-2026-03-09-at-8.45.02\u202fPM.png\" alt=\"BinLog Position\" width=\"341\" height=\"78\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2026\/03\/Screenshot-2026-03-09-at-8.45.02\u202fPM.png 1252w, \/blog\/wp-ttn-blog\/uploads\/2026\/03\/Screenshot-2026-03-09-at-8.45.02\u202fPM-300x69.png 300w, \/blog\/wp-ttn-blog\/uploads\/2026\/03\/Screenshot-2026-03-09-at-8.45.02\u202fPM-1024x234.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2026\/03\/Screenshot-2026-03-09-at-8.45.02\u202fPM-768x175.png 768w, \/blog\/wp-ttn-blog\/uploads\/2026\/03\/Screenshot-2026-03-09-at-8.45.02\u202fPM-624x143.png 624w\" sizes=\"(max-width: 341px) 100vw, 341px\" \/><p id=\"caption-attachment-78304\" class=\"wp-caption-text\">BinLog Position<\/p><\/div><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><strong>ROW binlog format<\/strong> ensures row-level changes are captured properly.<br \/>\nWhen we use the snapshot + CDC approach, the CDC task should start from the <strong>exact binlog position corresponding to the snapshot creation time.<\/strong><br \/>\nIf the CDC task starts from a later binlog position, transactions that occurred between the snapshot and CDC start will be lost.<\/p>\n<p><strong>Phase 3: Account-to-Account Networking<br \/>\n<\/strong>Cross-account networking needs to be set up because DMS needs to access both RDS.<br \/>\nDirect network connectivity between VPCs in two accounts can be achieved by VPC peering or Transit Gateway.<\/p>\n<p><strong>Phase 4: Establishing the DMS Replication Configuration<br \/>\n<\/strong>Actual data replication is carried out by a replication instance.<\/p>\n<p>Configuration parameters:<\/p>\n<ul>\n<li>Instance of class dms.r5.XX for Mid size database migrations and higher for huge databases<\/li>\n<li>100\u2013200 GB of storage, can be increased later on in case of requirement.<\/li>\n<li>Multi-AZ for Production workloads<\/li>\n<li>Access for the public is disabled.<\/li>\n<\/ul>\n<p><strong>Considerations for placement:<\/strong><\/p>\n<ul>\n<li>Deploy in VPC that can reach both source and target RDS<\/li>\n<li>Set up security groups to permit database ports for DMS Instance.<\/li>\n<\/ul>\n<p><strong>Phase 5: Creating DMS Instance<\/strong><br \/>\nA <strong>Replication Instance<\/strong> is the core compute component that runs migration tasks in AWS Database Migration Service.<br \/>\nIt connects to the source database, reads transaction logs, and applies changes to the target database such as Amazon Relational Database Service.<\/p>\n<p>It works like <strong>migration engine that processes replication pipelines<\/strong>.<\/p>\n<p><strong>Open AWS DMS Console<\/strong><br \/>\nNavigate to: AWS Console \u2192 Database Migration Service\u2192 Replication Instances<br \/>\nClick: Create replication instance<\/p>\n<p><strong>Configure Basic Instance Settings<\/strong><br \/>\n<strong>Replication Instance Identifier<\/strong> : Provide a unique identifier.<br \/>\nExample: prod-mysql-migration-dms<br \/>\nBest practice naming: &lt;environment&gt;-&lt;source&gt;-&lt;target&gt;-dms<br \/>\n<strong>Instance Class<\/strong> :-Defines CPU and memory capacity.<br \/>\n<strong>Common production sizes<\/strong>: Example configuration: Instance Class: dms.r5.large(vCPU: 2, Memory: 16 GB)<\/p>\n<p><strong>Rule of thumb:<\/strong> Large tables + CDC + many tasks should have a bigger instance class.<\/p>\n<p><strong>Engine Version<\/strong><br \/>\nChoose the <strong>latest stable DMS engine version<\/strong>.<\/p>\n<p><strong>Benefits:<\/strong><strong><br \/>\n<\/strong><\/p>\n<ul>\n<li>Bug fixes<\/li>\n<li>Improved CDC performance<\/li>\n<li>Better LOB handling<\/li>\n<\/ul>\n<p><strong>Allocated Storage<br \/>\n<\/strong>Defines storage used for:<\/p>\n<ul>\n<li>task logs<\/li>\n<li>cached transactions<\/li>\n<li>sorting during migration<\/li>\n<\/ul>\n<p>Typical values: Example: Allocate<\/p>\n<div id=\"attachment_78309\" style=\"width: 538px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-78309\" decoding=\"async\" loading=\"lazy\" class=\"wp-image-78309 \" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2026\/03\/Screenshot-2026-03-10-at-6.42.05\u202fPM.png\" alt=\"DMS Instance Classes\" width=\"528\" height=\"201\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2026\/03\/Screenshot-2026-03-10-at-6.42.05\u202fPM.png 736w, \/blog\/wp-ttn-blog\/uploads\/2026\/03\/Screenshot-2026-03-10-at-6.42.05\u202fPM-300x114.png 300w, \/blog\/wp-ttn-blog\/uploads\/2026\/03\/Screenshot-2026-03-10-at-6.42.05\u202fPM-624x237.png 624w\" sizes=\"(max-width: 528px) 100vw, 528px\" \/><p id=\"caption-attachment-78309\" class=\"wp-caption-text\">DMS Instance Classes<\/p><\/div>\n<p><strong>Network Configuration<\/strong><br \/>\nThe replication instance must run inside a VPC, Select Your VPC, Replication subnet group, VPC security groups, AWS KMS key then other details like Maintenance Window, Tags etc.<br \/>\nThen Create your DMS Instance.<\/p>\n<p><strong>Source Endpoint (Account A)<br \/>\n<\/strong>Required parameters:<\/p>\n<ul>\n<li>Server name<\/li>\n<li>Port<\/li>\n<li>Database Endpoint DNS<\/li>\n<li>Username<\/li>\n<li>Password<\/li>\n<li>Required privileges for the migration user:\n<ul>\n<li>REPLICATION CLIENT<\/li>\n<li>REPLICATION SLAVE<\/li>\n<li>SELECT<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>Connectivity should be verified using the<strong> Test Endpoint Connection<\/strong> feature.<\/p>\n<p><strong>Target Endpoint (Account B)<\/strong><br \/>\nRequired parameters:<\/p>\n<ul>\n<li>Server name<\/li>\n<li>Port<\/li>\n<li>Database Endpoint DNS<\/li>\n<li>Username<\/li>\n<li>Password<\/li>\n<\/ul>\n<p>The target database must allow connections from the replication instance security group.<\/p>\n<p><strong>Phase 6 \u2014 Configuring CDC Migration Task<\/strong><br \/>\nSince the snapshot already transferred the baseline dataset, the DMS task should run in <strong>CDC mode only<\/strong>.<\/p>\n<p><strong>Task configuration:<\/strong><\/p>\n<ul>\n<li>Task identifier name : Provide a name for this task.<\/li>\n<li>Descriptive Amazon Resource Name (ARN) &#8211; optional<\/li>\n<li>Source database endpoint : Choose a source database endpoint<\/li>\n<li>Target database endpoint : Choose a target database endpoint<\/li>\n<li>Task mode\n<ul>\n<li>Provisioned : Select the amount of compute you want to dedicate to your migration or replication task<\/li>\n<li>Serverless : DMS Will dynamically adjusts the level of compute needed for your migration or replication task(This will not need DMS instance which we have created Phase 5)<\/li>\n<\/ul>\n<\/li>\n<li>Provisioned instance : Choose a provisioned instance<\/li>\n<li>Task typeInfo\n<ul>\n<li>Replicate only :This will replicate data from source to target(CDC only)<\/li>\n<\/ul>\n<\/li>\n<li>CDC configuration\n<ul>\n<li>Enable custom CDC start mode<\/li>\n<li>CDC start point for source transactions<\/li>\n<li><strong>Native CDC start point<\/strong> : Put your Bin Log file position here in below format:-<br \/>\n<strong>mysql-bin-changelog.000024:373<\/strong><\/li>\n<\/ul>\n<\/li>\n<li>CDC stop mode for source transactions : Disable custom CDC stop mode(It will allow you to stop CDC when you want to stop)<\/li>\n<li>Setting Editing mode<\/li>\n<li>Wizard<\/li>\n<li>Target table preparation mode\n<ul>\n<li>Do nothing(This will only put the changes on the Datasets)<\/li>\n<\/ul>\n<\/li>\n<li>Include LOB columns in replicationInfo\n<ul>\n<li>Limited LOB mode : Should be a numeric value of Max LOB size in your Dataset.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><strong>Log settings<\/strong><\/p>\n<ul>\n<li><strong>Task logs<\/strong>\n<ul>\n<li>Turn on CloudWatch logs, DMS task logging uses Amazon CloudWatch to log information during the migration process. You can change the component activities logged and the amount of information logged for each one.<\/li>\n<\/ul>\n<\/li>\n<li><strong>Table mappings<\/strong>\n<ul>\n<li><strong>Editing mode<\/strong> : Wizard(You can enter only a Dataset\/Database names here)Ex:-<\/li>\n<li>Schema name, Schema table name, Action(Include or Exclude)<\/li>\n<\/ul>\n<\/li>\n<li><strong>Premigration assessment<\/strong>\n<ul>\n<li>A premigration assessment warns you about potential issues before migration begins, running efficiently, and has a minimal impact on your databases.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><strong>Migration task startup configuration<\/strong><\/p>\n<ul>\n<li>Start migration task\n<ul>\n<li>Automatically on create<\/li>\n<li>Manually later(Recommended)<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><strong>Monitoring the Migration<\/strong><br \/>\nMonitoring replication health is critical for production migrations.<\/p>\n<p>Key metrics: CDCLatencySource(Time between commit and capture), CDCLatencyTarget(Time to apply change to target), CDCIncomingChanges(Replication throughput).<\/p>\n<ul>\n<li>Monitoring tools include:\n<ul>\n<li>CloudWatch metrics<\/li>\n<li>DMS task logs<\/li>\n<li>Table statistics dashboard<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><strong>Potential Issue you may face:-<br \/>\n<\/strong>Foreign Key Conflicts :- During CDC replication, insert order may violate foreign key constraints which can cause errors.<br \/>\nExample error: Cannot add or update a child row: a foreign key constraint fails<br \/>\nCommon mitigation: SET FOREIGN_KEY_CHECKS=0;<br \/>\nThis will disable constraints during migration and re-enable after replication completes.<\/p>\n<ul>\n<li><strong>Final Cutover Procedure<\/strong><br \/>\nWhen CDC latency comes to minimal, perform the final cutover.<br \/>\nStandard procedure:<\/p>\n<ol>\n<li>Pause application writes<\/li>\n<li>Allow CDC replication to reach zero lag<\/li>\n<li>Validate row counts and checksums<\/li>\n<li>Update application database endpoint<\/li>\n<li>Resume application traffic<\/li>\n<\/ol>\n<\/li>\n<\/ul>\n<p>Typical downtime is <strong>less than a few minutes<\/strong>.<\/p>\n<p><strong>Validation and Data Consistency<\/strong><br \/>\nBefore switching production traffic, verify dataset integrity.<br \/>\nCommon checks should match with source RDS include:<br \/>\n<strong>Row counts :<\/strong> SELECT COUNT(*) FROM table_name;<br \/>\n<strong>Checksum validation :<\/strong> CHECKSUM TABLE table_name;<br \/>\nSchema comparison tools can also ensure structural consistency.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Migrating databases between AWS accounts is often necessary for environment isolation, organizational changes, or setting up security boundaries. Basic migrations can be performed using dumps or replication. However, production environments need minimal downtime, consistency guarantees, and controlled cutover procedures. A strong method for migrating databases between accounts is to combine snapshot-based data transfer with Change [&hellip;]<\/p>\n","protected":false},"author":2167,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":17},"categories":[5877],"tags":[8449,4843,8448,3940,1703,8447],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/78263"}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/2167"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=78263"}],"version-history":[{"count":2,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/78263\/revisions"}],"predecessor-version":[{"id":78310,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/78263\/revisions\/78310"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=78263"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=78263"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=78263"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}