Skip to main content
Migration: Self-managed → Amazon MSK

On-prem to MSK: S3 is the bridge, not a VPN

Your data center and your new MSK cluster do not need a network path to each other. Back up on-prem to S3, restore into MSK, and carry every consumer group position across the gap.

Why migrate to MSK through object storage

Most plans to migrate to MSK start with MirrorMaker 2 and a site-to-site VPN or Direct Connect. That works, but it makes the network link the project's critical path. The link must stay up for the whole sync, carry your full produce rate, and clear every firewall review between your data center and AWS.

One tool is off the table entirely: AWS MSK Replicator only copies topics between MSK clusters, so it cannot pull from a self-managed source. For the on-prem leg you are choosing between MirrorMaker over a private link and a backup-based move through S3.

The S3 route needs no connection between the clusters. The on-prem cluster writes a compressed backup to a bucket. MSK restores from the same bucket, in the same region, so the heavy transfer happens inside AWS.

ConcernMirrorMaker 2 over VPNBackup and restore via S3
Network path between clustersContinuous, sized for full produce rateNone — one bucket in the middle
Validated copy before cutoverNoYes — validate --deep on the backup
Consumer offsets on MSKCheckpoint-topic translationOffset headers, exact repositioning
Firewall / security reviewInbound-outbound cluster linkOutbound HTTPS to S3 only
RollbackImprovisedSource untouched until you decommission it

The move, end to end

Take the backup with include_offset_headers: true — that single key is what lets consumer groups resume at the right position on MSK. Restore over SASL/SCRAM on port 9096 or mutual TLS on 9094, whichever your MSK cluster exposes. The bucket and IAM setup is covered in the AWS S3 setup guide.

Back up the on-prem cluster to the transfer bucket
mode: backup
backup_id: "onprem-to-msk-seed"

source:
bootstrap_servers:
- kafka-1.dc.internal:9092
- kafka-2.dc.internal:9092
topics:
include:
- "*"
exclude:
- "__consumer_offsets"

storage:
backend: s3
bucket: kafka-msk-migration
region: eu-west-1
prefix: transfer/onprem

backup:
compression: zstd
include_offset_headers: true
source_cluster_id: "dc-prod"

Cutting over without losing writes

The seed backup moves the bulk of the data while producers keep running on-prem. Cutover then only has to cover the delta. Stop producers, take a second backup of the gap, restore it to MSK, and repoint applications. The freeze window scales with the delta, not with the full data volume.

Keep the offset_report file from each restore — it records where every consumer group landed, which is the artifact your cutover review will ask for. The full procedure, including the rollback backup of the target, is in the migration guide. Every key used above is documented in the configuration reference.

One decision before you provision anything: create the MSK cluster in KRaft mode. MSK supports KRaft from version 3.7.x, and there is no in-place conversion later — a ZooKeeper-mode cluster eventually needs the MSK ZooKeeper to KRaft move as a second migration.

Frequently asked questions

How do I migrate on-prem Kafka to Amazon MSK without a VPN or Direct Connect?

Use object storage as the bridge. The on-prem cluster writes a compressed backup to S3 over outbound HTTPS, and the MSK cluster restores from the same bucket. The two clusters never connect to each other, so no site-to-site link is required.

Can AWS MSK Replicator migrate a self-managed Kafka cluster to MSK?

No. MSK Replicator only replicates between Amazon MSK clusters, so it cannot use a self-managed cluster as its source. For on-prem to MSK you need MirrorMaker 2 over a network link or a backup-and-restore move through S3.

Do consumer groups keep their offsets when migrating to MSK?

Yes, when the backup is taken with include_offset_headers: true. The restore maps each committed source offset to its equivalent MSK offset with consumer_group_strategy: header-based, and the offset_report file records every mapping.

How much downtime does an on-prem to MSK migration need?

Only the delta window. Seed the bulk of the data to MSK while on-prem producers keep running, then freeze producers, move the final delta backup, and repoint applications. The freeze covers minutes of new data, not the full history.

Should a new MSK cluster use KRaft or ZooKeeper mode?

KRaft. MSK supports KRaft from Kafka 3.7.x, ZooKeeper was removed upstream in Kafka 4.0, and MSK has no in-place conversion — a ZooKeeper-mode cluster would need a second cluster-move migration later.

Ready to protect your Kafka data?

Take your first backup in minutes with the open source CLI, or talk to us about Enterprise features like encryption, RBAC, and audit logging.