All Products
Search
Document Center

ApsaraMQ for Kafka:Import metadata from a self-managed Apache Kafka cluster

Last Updated:Mar 11, 2026

When migrating from a self-managed Apache Kafka cluster to ApsaraMQ for Kafka, you need to recreate your topic and consumer group configurations on the destination instance. The metadata import feature reads these configurations from your source cluster and creates them on the ApsaraMQ for Kafka instance, so you don't have to recreate them manually.

What gets migrated

Metadata typeWhat is imported
TopicsTopic names, partition counts, message types
Consumer groupsGroup IDs, descriptions

How it works

The metadata import follows a four-step process:

  1. (Optional) Evaluate specifications -- Get recommended instance specifications based on your source cluster's workload.

  2. Export metadata -- Run a JAR tool on a node in your self-managed cluster. The tool connects to ZooKeeper, reads topic and consumer group configurations, and writes them to a JSON file.

  3. Create a metadata import task -- Upload the JSON file to the ApsaraMQ for Kafka console and review topics and consumer groups before creating them on the destination instance.

  4. Verify the result -- Confirm that topics and consumer groups appear on the destination instance.

Prerequisites

Before you begin, make sure that you have:

Note

To determine the right instance specifications, complete the optional evaluation in Evaluate specifications before purchasing.

Limitations

  • Metadata import is not supported for serverless ApsaraMQ for Kafka instances.

Evaluate specifications (optional)

Use the specification evaluation feature to get recommended instance specifications based on your self-managed cluster's workload.

  1. Log on to the ApsaraMQ for Kafka console. In the Resource Distribution section of the Overview page, select the region of your destination instance.

  2. In the left-side navigation pane, click Migration. Click the Metadata Import tab.

  3. Click Evaluation.

  4. In the Evaluation panel, enter your source cluster's workload information:

    ParameterDescriptionRequiredExample
    Major VersionApache Kafka version in your self-managed clusterYes0.10.x
    Migration from IDCWhether the source cluster runs in an Internet data center (IDC)YesYes
    Maximum Cluster TrafficPeak message production or consumption throughput, in MB/sYes20
    Public Network TrafficRequired internet bandwidth, in MB/s. Enter 0 if internet access is not neededYes0
    SSDWhether the source cluster uses solid-state drives (SSDs)YesYes
    Disk CapacityTotal disk capacity, in GBYes500
    PartitionsTotal number of partitions across all topics to migrateYes800
    ReplicasNumber of replicas per topicYes3 Replicas
    ScenarioWorkload type for message production and consumptionYesBusiness Message
    Response LatencyLatency requirements for message production and consumptionYesNo Special Requirements
  5. Click OK. The Recommended Instance Specifications section displays the recommended edition, traffic specification, and disk size for your destination instance.

Export the metadata

Run the metadata export tool on a node in your self-managed Apache Kafka cluster to generate a JSON file containing topic and consumer group configurations.

  1. Download the metadata export tool: kafka-migration-assessment.jar.

  2. Upload the JAR file to a node in your self-managed Kafka cluster.

  3. Grant execute permission on the JAR file:

       chmod 777 kafka-migration-assessment.jar
  4. Run the export command: Replace the placeholders with your values:

    ParameterDescriptionRequiredDefaultExample
    sourceZkConnectIP address and port of the ZooKeeper node for your self-managed cluster. If omitted, the tool auto-detects this valueNoAuto-detected192.168.XX.XX:2181
    sourceBootstrapServersIP address and port of a Kafka broker in your self-managed cluster. If omitted, the tool auto-detects this valueNoAuto-detected192.168.XX.XX:9092
    targetDirectoryDirectory to write the output JSON fileNoCurrent directory../home/
    fileNameName of the output JSON fileNokafka-metadata-export.jsonmetadata.json
    commitCommits the taskYes----
    installTsarInstalls Taobao System Activity Reporter (Tsar) to collect machine specifications and resource usage. Installation may take a long time and can fail in incompatible environmentsNoNot installed--
    evaluateCollects machine specifications and resource usage for specification evaluation. Set to false to skipNotruefalse
       java -jar kafka-migration-assessment.jar MigrationFromZk \
         --sourceZkConnect <zookeeper-host:port> \
         --sourceBootstrapServers <kafka-host:port> \
         --targetDirectory <output-directory> \
         --fileName <output-filename> \
         --commit
  5. Verify that the JSON file exists in the specified output directory.

    Note

    Download the file to your local machine for uploading to the ApsaraMQ for Kafka console in the next step.

Create a metadata import task

Upload the exported JSON file and configure the topics and consumer groups to create on the destination ApsaraMQ for Kafka instance.

  1. Log on to the ApsaraMQ for Kafka console. In the Resource Distribution section of the Overview page, select the region of your destination instance.

  2. In the left-side navigation pane, click Migration. Click the Metadata Import tab.

  3. Click Create Task.

  4. In the Create Metadata Import Task panel, complete the following steps: Create Task Configure Task Name and Destination Instance, then upload the metadata JSON file exported in Export the metadata. Edit Topic Review the imported topics and adjust as needed: Edit Group Review the imported consumer groups and adjust as needed:

    • Add a group: Click Add Group and configure the Group ID and Description parameters.

    • Modify a group: Click Modify in the Actions column to update the Description.

    • Delete a group: Click Delete in the Actions column, then click OK in the confirmation dialog.

  5. Click Create to start the metadata import task. After the task is created, the Metadata Import tab shows the Topic Migration Progress and Group Migration Progress for each task. Click Details in the Actions column to view the full task details.

Verify the migration result

Confirm that the topics and consumer groups were created on the destination instance.

  1. Log on to the ApsaraMQ for Kafka console. In the Resource Distribution section of the Overview page, select the region of your destination instance.

  2. In the left-side navigation pane, click Instances. Click the name of the destination instance.

  3. Verify the topics: In the left-side navigation pane, click Topics. Confirm that all expected topics are listed.

  4. Verify the consumer groups: In the left-side navigation pane, click Groups. Confirm that all expected consumer groups are listed.