Migrate Data with Redpanda Migrator
This lab demonstrates how to use Redpanda Migrator to migrate data from a source Kafka-compatible cluster to a target Redpanda cluster.
Redpanda Migrator is built on Redpanda Connect and provides continuous data replication with automatic topic creation, schema migration, and consumer offset synchronization.
What you’ll explore
In this lab, you will:
-
Run Redpanda Migrator for continuous data replication between clusters
-
Explore SASL authentication and ACL-based authorization for secure migration
-
Observe topic and schema migration with preserved configurations
Architecture
This lab creates a complete migration environment:
-
Source cluster: Simulates a Confluent Kafka cluster with SASL authentication, demo topics, and registered schemas
-
Target cluster: Redpanda cluster with matching security configuration
-
Redpanda Migrator: Continuously replicates data, schemas, and offsets from source to target
-
Console instances: Web UIs for both clusters to observe the migration in real-time
The migrator automatically creates topics with matching partition counts and configurations, preserves schema IDs and versions, and migrates consumer offsets.
Prerequisites
-
At least 4GB RAM available
-
GNU Make (usually pre-installed on Linux/macOS)
This lab is for Linux and macOS users. If you are using Windows, you must use the Windows Subsystem for Linux (WSL) to run the commands in this lab.
Run the lab
-
Clone this repository:
git clone https://github.com/redpanda-data/redpanda-labs.git -
Change into the
docker-compose/redpanda-migrator-demo/directory:cd redpanda-labs/docker-compose/redpanda-migrator-demo -
(Optional) Set container versions.
The
docker-compose.ymlfile uses default versions. To use specific versions, set these environment variables:export REDPANDA_VERSION=26.1.9 export REDPANDA_CONSOLE_VERSION=3.7.3 export REDPANDA_CONNECT_VERSION=4.93.0For all available Redpanda versions, see the GitHub releases.
-
Start the demo environment:
make startThis command starts the source and target Redpanda clusters, Redpanda Console instances, and the migrator service. See
docker-compose.ymlfor port mappings and service details. -
Set up users, ACLs, topics, and schemas:
make setupThis creates users with SASL authentication, configures ACLs for secure migration, creates demo topics with various cleanup policies, and registers schemas. See
scripts/setup.shfor detailed ACL permissions and topic configurations. -
(Optional) Verify the ACL configuration:
make verify-aclsThis confirms that
migrator-userhas correct read-only source access and read-write target access with proper restrictions. Seescripts/verify-acls.shfor test details. -
Start continuous data production:
make demo-startThis starts a background producer that sends approximately 80 messages every 2 seconds across all demo topics.
-
(Optional) View the migration in Redpanda Console:
Open your browser to observe the migration in real-time:
-
Source cluster: http://localhost:8080
-
Target cluster: http://localhost:8081
You can see topics, messages, and schemas being replicated from source to target.
-
-
(Optional) Verify continuous schema syncing:
make verify-continuous-schemaThis command registers a new schema after the migrator starts and confirms it automatically appears in the target Schema Registry within 15 seconds.
-
Monitor migration lag:
make monitor-lagThis command displays a real-time dashboard showing lag per topic, message counts, and production status. Watch as the lag decreases to 0, indicating the migrator has caught up with the source cluster. Let it run for 30-60 seconds to observe continuous replication, then press Ctrl+C to exit.
-
Verify data consistency:
Run the verification script to confirm successful migration:
make verifyThis command checks that all topics, partitions, messages, cleanup policies, and schemas have been migrated correctly.
-
Stop continuous production:
make demo-stop -
Disable Schema Registry import mode:
This step is required to return the target Schema Registry to normal operations. The target Schema Registry must be in import mode for schema migration to work (enabled automatically by
make setup). After migration completes, disable import mode:curl -X PUT http://localhost:28081/mode \ -H "Content-Type: application/json" \ -u 'admin-user:admin-secret-password' \ -d '{"mode":"READWRITE"}'Import mode allows the migrator to register schemas with preserved IDs and versions. When migration is done, return to readwrite mode for normal operations.
Configuration
The migrator uses the principle of least privilege with non-superuser accounts. For detailed security configuration including users, ACLs, and permissions, see:
-
scripts/setup.sh: User creation and ACL configuration -
config/migrator-config.yaml: Migrator settings and Schema Registry sync -
docker-compose.yml: Service ports and environment variables
This lab uses single-node clusters and demo credentials for simplicity. For production migrations, use multi-node clusters with strong, randomly generated passwords stored in a secrets manager such as HashiCorp Vault or AWS Secrets Manager.
Troubleshoot
Next steps
After running this demo:
-
Read the Redpanda Migrator documentation
-
Learn about Schema Registry configuration
-
Explore Redpanda authentication options