Plan each migration batch
Start with a non-critical but representative workload. Expand the scope only after the pilot passes. Keep dependent producers, topics, and consumers in the same batch so that a business data flow is not split across migration stages. Record the following information before migration:
Avoid unrelated source-cluster upgrades, broker replacements, network changes, authentication changes, and topic recreation during the migration window. Limiting concurrent changes makes failures easier to attribute.
Configure reliable source endpoints
A Kafka client usesbootstrap.servers to obtain cluster metadata. It then connects to the broker addresses returned through advertised.listeners. A successful connection to only the bootstrap address does not prove that Kafka Linking can reach the cluster.
Validate the source connection as follows:
- Use stable DNS names or the source Kafka service’s formal endpoint. When you configure multiple endpoints, distribute them across failure domains.
- Confirm that the AutoMQ data plane can resolve and connect to every broker address and port returned in metadata.
- For a Kubernetes source cluster, use the Kafka Operator or platform-provided stable bootstrap service and stable per-broker external listeners.
- Allow both the bootstrap endpoints and all advertised broker endpoints through firewalls, security groups, routes, and network access controls.
- For TLS or mTLS, verify the trust chain, the hostname against the certificate SAN, and the certificate lifetime.
- Use a dedicated migration identity with the permissions required to read the selected topics, inspect Consumer Groups, and discover metadata. Do not rotate or delete this identity during migration.
advertised.listeners or network access before creating the Kafka Link if any broker is unreachable.
Prepare the source and target clusters
Complete these checks before creating a Kafka Link:- Reserve enough target capacity for migration traffic as described in Prerequisites.
- Make sure that a topic with the same name does not already exist on the target. Kafka Linking must create a Mirror Topic for the source topic.
- Keep source topic identity and partition structure stable within a migration batch. Do not delete and recreate a topic with the same name.
- Keep target data long enough to cover the migration and observation windows. The target must not expire records that a consumer still needs before cutover.
- Validate Kafka ACLs, certificates, Schema Registry, connectors, and other external dependencies on the target. Do not assume that topic data synchronization migrates every surrounding configuration or state.
- Save a baseline of topic configurations, partition ranges, Consumer Group offsets, and business traffic on both clusters.
From the time a Mirror Topic is created until it is promoted to
PROMOTED, do not increase the partition count of either the source topic or the target Mirror Topic. The source and target partition counts must remain unchanged while Kafka Linking is in progress.Keep the source cluster, its network path, DNS endpoints, and migration identity available until every Mirror Topic and Consumer Group is promoted and business acceptance passes. Do not stop, scale to zero, delete, or release the source cluster early, and do not revoke Kafka Linking’s access permissions.
Cut over standard producers and consumers
This workflow applies to producers that do not use Kafka transactions. Producers with atransactional.id must use the transactional producer workflow.
- Move standard producers to the target AutoMQ instance in batches, then recreate or restart the clients. While a Mirror Topic is
LINKING, Kafka Linking routes these writes to the source and replicates them back to the target. - Check every producer deployment and send callback. Confirm that no untracked producer instance continues to write directly to the source.
- Before moving a Consumer Group, confirm that the actual startup offset for every partition is within the target topic’s readable range. See Validate the consumer’s actual offset source for the offset sources used by different clients.
- Change the Consumer connection configuration and perform a rolling deployment so that instances connect to the target AutoMQ instance in batches. Briefly running the same
group.idon the source and target is expected during the rollout. Kafka Linking completes Consumer Group promotion after all source instances have exited. - Confirm that every Consumer instance connects to the target and Consumer Group promotion is complete. Validate consumption rate, lag, business results, and errors, and complete the observation window before moving the next workload.
Cut over transactional producers
Kafka transactions cannot use the rolling proxy workflow for standard producers. Use the following order for any application that setstransactional.id or depends on exactly-once semantics:
- Keep the transactional producer on the source while target replication lag converges.
- Stop transactional producers on the source. Confirm that every open transaction has committed or aborted.
- Compare source and target end offsets for every partition. Confirm that the target has caught up with the source.
- Promote every Mirror Topic involved in the transactions and wait for the
PROMOTEDstate. - Confirm that old producer instances cannot restart. Then start the transactional producers on the target.
- Use
read_committedconsumers to verify committed records from before and after promotion, and validate the end-to-end transactional result.
Validate the consumer’s actual offset source
The consumer startup position depends on how the client manages state:
For every topic-partition, verify:
[80, 150]. A range of [120, 150] means that the historical record at offset 100 is no longer readable. A range of [80, 90] means that the target has not replicated through offset 100, so wait for the target to catch up.
auto.offset.reset applies only when the client has no valid starting offset. It does not override a Flink restore or an explicit assign and seek from an external offset store.Promote Mirror Topics
Promotion stops write routing and replication from the source for a topic. Pass every gate before promotion:
Kafka Linking remains connected to the source and routes writes during
LINKING, so source-cluster connections alone do not indicate that workload Producers have not switched. For a low-frequency topic, do not use a short zero-traffic window as the only proof that a Producer has stopped. Check the workload Producer inventory and deployment configuration, and compare source and target write requests over a window longer than the normal message interval.
Promote topics by business batch instead of promoting the entire migration at once. Validate each batch before continuing.
During Mirror Topic promotion, a small number of writes that still reach the old routing path can briefly receive
OUT_OF_ORDER_SEQUENCE_NUMBER. For non-transactional producers with idempotence enabled and normal retry settings, Kafka clients typically reset the sequence state and retry automatically, so applications usually do not need to intervene. Monitor final send failures. Investigate client configuration, Topic state, and residual routed traffic only if the error is ultimately returned to the application or continues after promotion; compensate only records confirmed as failed according to the application’s idempotency policy.Define rollback boundaries
Rollback semantics change after promotion:- Before promotion: Standard producers can return to the source. Before moving consumers back, reconcile the source Consumer Group offset or expect records already processed on the target to be replayed.
- After promotion: New target records no longer replicate to the source. Changing only
bootstrap.serverswould return clients to a source cluster that is missing post-promotion records. Stop the cutover and use a data reconciliation or reverse-migration plan.
Complete the migration
End a Kafka Linking migration only after all of these conditions are met:- Every Mirror Topic in the Kafka Link is
PROMOTED. - Every Consumer Group in the Kafka Link has completed promotion.
- Production, consumption, lag, error rate, and critical business results on the target AutoMQ instance pass acceptance, including the agreed observation window.
Do not delete the promoted Mirror Topics or Consumer Groups one by one. Deleting these resources deletes the corresponding topic or Group from the target AutoMQ instance and can cause message data or consumer offsets to be lost, or interrupt the workload. To complete the migration, delete only the Kafka Link itself.
Use the migration checklist
Keep at least the following evidence for each batch:- Stable source bootstrap endpoints and connectivity results for every advertised broker endpoint.
- Migration identity permissions, certificate lifetime, and firewall approvals.
- Topic, producer, Consumer Group, external offset source, owner, and dependency inventories.
- Partition earliest offsets, end offsets, committed Group offsets, and replication lag before and after cutover.
- The selected standard or transactional producer cutover order.
- Evidence that source Groups became
Empty, target consumers stabilized, and business acceptance passed. - Mirror Topic promotion approval, execution time, observation result, and rollback boundary.
- Promotion results for every Mirror Topic and Consumer Group, the Kafka Link deletion record, and approval to reclaim the source cluster.