Migrate a Topic to Cloud Topics or Tiered Storage v2
| Storage mode migration is a beta feature. It is not supported for production deployments. Beta features are available for users to test and provide feedback. |
Starting in Redpanda v26.3, you can move an existing topic to the storage mode that fits its workload. You don’t recreate the topic or stop its producers and consumers. To compact the entire partition in object storage and remove tombstones, which Tiered Storage v1 can’t do, migrate to Tiered Storage v2 (beta). To lower storage costs for workloads that can accept higher latency, migrate to Cloud Topics.
You can migrate local, unset, and Tiered Storage v1 topics. Each topic keeps its name, partitions, offsets, and consumer group positions.
After reading this page, you will be able to:
-
Enable storage mode migration and migrate an existing topic to Cloud Topics or Tiered Storage v2
-
Monitor a migration
How migration works
When you change a topic’s storage mode to cloud or tiered_v2, the topic’s storage mode changes to the target immediately. Each partition then migrates in the background:
-
Each partition keeps serving reads and writes in its original storage mode. Meanwhile, Redpanda records the partition’s existing Tiered Storage v1 data in the target storage mode. Redpanda references this data in place and doesn’t copy it. A partition of a
localtopic has no Tiered Storage v1 data to record, so it goes straight to the next step. -
The partition then cuts over to the target storage mode. New data is written in the target storage mode. Reads of older data use the referenced Tiered Storage v1 data, which ages out under the topic’s retention settings. Data that was only on local disk, such as the data of a
localtopic, starts copying to object storage. -
The migration is complete when every partition has cut over.
Partitions that you add to the topic during a migration are created in the target storage mode.
Prerequisites
-
A BYOC or Dedicated cluster running Redpanda v26.3 or later. You enable migration with a cluster property, which Serverless clusters don’t support.
-
To migrate to Tiered Storage v2, all brokers must also meet the Tiered Storage v2 requirements.
Limitations
-
You can’t migrate a remote read replica topic directly. Instead, a remote read replica topic migrates along with its source topic, whether or not migration is enabled on the remote read replica cluster.
-
You can’t migrate a shadow topic directly, because Redpanda rejects changes to a shadow topic’s properties. Instead, a shadow topic follows the migration of its source topic. When you migrate a source topic, its shadow topic migrates too, if migration is enabled on the shadow cluster. If it isn’t, the shadow topic keeps its storage mode while replication continues, and it migrates after you enable migration on the shadow cluster.
-
You can’t cancel a migration or return a migrated topic to
localor Tiered Storage v1. A migration can’t be reversed. See Back out of a failed migration. You can still convert a topic betweencloudandtiered_v2, even during the migration. -
Redpanda migrates at most
topic_storage_mode_migration_max_concurrent_partitionspartitions at a time across all topics (default: 128). Partitions over the limit wait until earlier partitions finish. -
Topics listed in
kafka_nodelete_topicsorkafka_noproduce_topics, such as_schemas, can’t be migrated while they’re in those lists, because Kafka clients can’t alter their configuration.
Compacted topics, transactional topics, and Iceberg topics can be migrated. While a partition migrates, Cloud Topics compaction skips it until the partition cuts over. Transactions that are open when the migration starts complete normally, and Iceberg translation continues without gaps.
Enable migration
Migration is disabled by default. To enable it, set the enable_topic_storage_mode_migration cluster property to true:
rpk cluster config set enable_topic_storage_mode_migration true
This property doesn’t require a restart. If the topic_storage_mode_migration cluster feature isn’t active yet, the request is rejected with Requires the topic_storage_mode_migration feature to be active.
Migrate a topic
To start a migration, change the topic’s storage mode with rpk topic alter-config.
To migrate a topic to Cloud Topics:
rpk topic alter-config <topic-name> --set redpanda.storage.mode=cloud
To migrate a topic to Tiered Storage v2 (beta), set the redpanda.storage.mode.impl topic property:
rpk topic alter-config <topic-name> --set redpanda.storage.mode.impl=tiered_v2
Setting redpanda.storage.mode.impl names the exact Tiered Storage version, regardless of the cluster default. If you set redpanda.storage.mode=tiered instead, the tiered value resolves to the version selected by the default_redpanda_storage_mode_tiered_impl cluster property. For a local topic, it starts a migration only when that property is tiered_v2. With the default (tiered_v1), setting tiered on a local topic enables Tiered Storage v1 instead of migrating the topic. Setting tiered on a Tiered Storage v1 topic has no effect, so to migrate a Tiered Storage v1 topic, set redpanda.storage.mode.impl=tiered_v2.
If you set both properties in the same request, their values must agree.
Because a migration can’t be reversed, rpk topic alter-config asks you to confirm any change that migrates a topic. The prompt lists the topics that the change migrates:
Warning: this change migrates the storage mode of topics [<topic-name>] to cloud or tiered_v2. A migration cannot be reverted. Abort?
Answer no to continue with the migration. To skip the prompt, for example in scripts, add the --no-confirm flag:
rpk topic alter-config <topic-name> --set redpanda.storage.mode=cloud --no-confirm
To confirm that the migration started, check the topic’s storage mode:
rpk topic describe <topic-name> -c | grep redpanda.storage.mode
The redpanda.storage.mode and redpanda.storage.mode.impl properties report the target storage mode as soon as the migration starts, even while partitions are still migrating. To see the progress of the migration, see Monitor migration progress.
If migration isn’t enabled, or the topic can’t be migrated, the request is rejected with an error such as:
Cannot alter redpanda.storage.mode from local to cloud - this transition is not permitted
For all permitted storage mode changes, see Change the storage mode.
Monitor migration progress
To check the progress of migrations, use the following public metrics:
| Metric | Description |
|---|---|
|
Number of migrating partitions per topic, labeled by |
|
Number of partitions migrating across the cluster. |
|
Number of topics with a migration in progress. |
|
Number of topics whose partitions have all migrated, but whose Tiered Storage v1 data is still retained. |
Back out of a failed migration
A migration can’t be reversed. If a migration fails and you can’t resolve it, contact Redpanda support.