# Migrating Kafka topics without downtime

DevFeed: [Migrating Kafka topics without downtime](<https://devfeed.tech/articles/migrating-kafka-topics-without-downtime-39620.md>)

Original publisher: [Read original article](<https://www.gauravsarma.com/posts/2022-09-15_Migrating-Kafka-topics-without-downtime-f863819cfb3d>)

Published: 2022-09-15T00:00:00Z

Content type: tutorial

Language: en

Sources: [Gaurav Sarma's Blog](<https://devfeed.tech/sources/gaurav-sarma-s-blog.md>)

Topics: [Kafka](<https://devfeed.tech/topics/kafka.md>), [ordering](<https://devfeed.tech/topics/ordering.md>), [Scalability](<https://devfeed.tech/topics/scalability.md>), [version](<https://devfeed.tech/topics/version.md>)

Tags: [downtime](<https://devfeed.tech/tags/downtime.md>), [kafka](<https://devfeed.tech/tags/kafka.md>), [ordering](<https://devfeed.tech/tags/ordering.md>), [partition](<https://devfeed.tech/tags/partition.md>), [versioning](<https://devfeed.tech/tags/versioning.md>)

## AI overview

A tutorial for migrating Kafka topics by creating versioned replacement topics, redirecting publishers and consumers, and draining the old topics. It explains how partition counts affect ordering, concurrency, scalability, and management overhead, and notes that the author did not find a direct tool for migration without downtime.

## Source excerpt

Each kafka topic defines the number of partitions and replication factors when it's created. However, once a topic is created, the partition count cannot be changed without affecting the ordering guarantees of the kafka partitions since kafka uses the following formula to calculate which partition a record should go to: partition\_id = partition\_key % number of partitions Kafka partitions are the gateway to concurrency and scalability...