You can use Identical topic name replication for cluster migration, but your consumers must be able to handle duplicate messages without downstream impact. This is because MSK Replicator provides at-least-once replication, which can lead to duplicate messages in rare scenarios. If your consumers meet this requirement, follow these steps.
Create a Replicator that replicates data from your old cluster to the new cluster with Replicator's starting position set to Earliest and using Identical topic name replication (Keep the same topics name in console).
Configure cluster-level settings and permissions on the new cluster. You do not need to configure topic-level settings and “literal” read ACLs, as MSK Replicator automatically copies them.
Monitor the
MessageLag
metric in Amazon CloudWatch until it reaches 0 which indicates all data has been replicated.After all data has been replicated, stop producers from writing data to the old cluster.
Reconfigure those producers to connect to the new cluster and start them.
Monitor
MaxOffsetLag
metric for your consumers reading data from the old cluster until it becomes0
, which indicates all existing data has been processed.Stop consumers that are connecting to the old cluster.
Reconfigure consumers to connect to the new cluster and start them.