On this page
Kafka migration in one paragraph
There are three different things called a Kafka migration and they share almost nothing. Moving from ZooKeeper to KRaft is a metadata-layer change on the same cluster, it is a prerequisite for the 4.x line because 4.0 removed ZooKeeper entirely, and it runs through a bridge mode that requires the brokers to be on a recent enough 3.x release first. Moving between platforms, whether self-managed to MSK, Confluent to open source, or anything to Redpanda, is a data migration where MirrorMaker 2 copies topics and translates consumer offsets, and where the cutover sequence decides whether you lose messages. Moving off Kafka entirely, usually to RabbitMQ, is an architecture decision that should be made on messaging pattern rather than on operational frustration. Each has a different risk, and only the first has a deadline set by the project.
ZooKeeper to KRaft: the one with a deadline
Kafka 4.0 runs on KRaft only. ZooKeeper is not deprecated in 4.0, it is gone, which makes this migration a prerequisite for every subsequent upgrade rather than an optional modernisation. The path runs through a bridge mode where a KRaft controller quorum takes over metadata while the existing brokers keep serving, so the brokers must already be on a 3.x release new enough to support migration before you start. Plan controller quorum sizing separately from broker sizing, and audit tooling for anything that still takes a ZooKeeper connection string, because those break silently.
Choosing the destination platform
Self-managed Apache Kafka, Amazon MSK, Confluent Platform, Confluent Cloud and Redpanda differ less in the protocol than in what you are responsible for and what a support contract can reach. The decision that matters operationally is which layer you keep: MSK gives you the brokers and leaves topics, consumers and connectors with you, while a fully managed service takes more and constrains more. Price the destination against the whole operating cost, engineer time included, rather than against the infrastructure line alone.
Copying the data: MirrorMaker 2 and offset translation
MirrorMaker 2 replicates topics between clusters and, importantly, translates consumer group offsets, because an offset on the source cluster does not mean the same thing on the target. It runs as a Connect cluster and needs its own capacity planning; a MirrorMaker deployment sized for the steady state will fall behind during the initial backfill. Decide early whether topic names are remapped with a cluster prefix or preserved, because that choice reaches into every client configuration and is painful to reverse mid-migration.
The cutover: where migrations actually fail
The safe sequence is to replicate until the target is caught up, stop producers, let consumers drain the source to zero lag, verify offsets translated correctly, then repoint producers and consumers together. Teams get into trouble by moving consumers before producers, which replays or skips depending on which way the offsets translated, or by running dual-write without a plan for reconciling the two clusters afterwards. Agree the rollback trigger before the window opens, and confirm the source cluster stays up and untouched long enough to roll back to.
If the destination is Kubernetes
Running Kafka on Kubernetes changes the failure modes rather than removing them: storage class and volume behaviour decide what a broker restart costs, pod anti-affinity decides whether a node failure takes a whole replica set, and rolling updates need to respect partition leadership rather than just pod readiness. It is a viable destination and a poor place to learn Kafka operations for the first time during a migration.
Migrating off Kafka, and when that is right
Some estates run Kafka for work that is a queue rather than a log: task distribution, request-reply, per-message routing, selective consumption. Those are RabbitMQ patterns, and forcing them onto Kafka produces the partition and consumer-group contortions that make teams describe Kafka as complicated. Make the call on messaging pattern, not on operational frustration, because moving to a broker you also do not operate well solves nothing.
Prove recovery on the new cluster before you trust it
A migrated cluster inherits none of the confidence the old one earned. Before the source is decommissioned, run the recovery you would need in an incident on the target: restore or replay to a known point, confirm the retention settings match what downstream systems assume they can replay, and write down the resulting RPO. Migrations are the most common moment for a disaster recovery plan to quietly stop being true.
Frequently asked questions
Do I have to migrate from ZooKeeper to KRaft?
Yes, if you intend to run Kafka 4.0 or later. The 4.0 release removed ZooKeeper entirely rather than deprecating it, so KRaft is a prerequisite for every subsequent upgrade. The migration runs through a bridge mode that requires the brokers to be on a recent enough 3.x release first.
How are consumer offsets handled in a Kafka cluster migration?
MirrorMaker 2 translates consumer group offsets between clusters, because the same offset number does not refer to the same message on the target. Verifying that translation before repointing consumers is the step that separates a clean cutover from one that replays or skips messages.
What is the safe cutover sequence?
Replicate until the target is caught up, stop producers, let consumers drain the source to zero lag, verify translated offsets, then move producers and consumers together. Moving consumers before producers is the most common way to lose or duplicate messages.
Should we migrate off Kafka to RabbitMQ?
Only if the workload is queue-shaped rather than log-shaped: task distribution, request-reply, per-message routing and selective consumption are RabbitMQ patterns. Make the decision on messaging pattern rather than on operational difficulty, which usually follows the team rather than the broker.
Related
Where this gets done
The work behind this page, run by the same engineers who wrote it.
- 24/7 Kafka supportSelf-managed, MSK or Confluent Platform
- Kafka consultingPartition strategy, sizing, security and migration
- RabbitMQ supportIf the estate runs both brokers
- Kubernetes and container servicesKafka on Kubernetes, operated with your team
- Enterprise MQ supportOne contract across Kafka, RabbitMQ and IBM MQ
- Enterprise support plansSLA tiers and what each covers
- Enterprise MQ consultingMulti-broker architecture and migration
Other Kafka guides, comparisons and research
Recent Kafka articles
- Kafka Rebalance: Triggers and How to Stop ItSep 2026
- Kafka Security Best Practices: SASL, ACLs & EncryptionSep 2026
- Kafka Exactly-Once Semantics: How It Works & Its LimitsSep 2026
- Kafka Retention Policy: Time-Based & Size-Based ConfigSep 2026
- Why Not Use RabbitMQ? Real Limits and Kafka MythsSep 2026
- How Much Does Kafka Enterprise Support Cost?Aug 2026
Need this done on your Kafka estate?
Named senior Kafka engineers, 24/7, with a 15-minute emergency SLA — self-managed, MSK or Confluent Platform.