tencent cloud

TDMQ for RocketMQ

Release Notes and Announcements
Release Notes
Announcements
Product Introduction
Introduction and Selection of the TDMQ Product Series
What Is TDMQ for RocketMQ
Strengths
Scenarios
Product Series
Comparison with Open-Source RocketMQ
High Availability
Quotas and Limits
Supported Regions
Basic Concepts
Billing
Billing Overview
Pricing
Billing Examples
Pay-as-you-go Switch to Monthly Subscription (5.x)
Renewal
Viewing Consumption Details
Refund
Overdue Payments
Getting Started
Getting Started Guide
Preparations
Step 1: Creating TDMQ for RocketMQ Resources
Step 2: Using the SDK to Send and Receive Messages (Recommended)
Step 2: Running the TDMQ for RocketMQ Client (Optional)
Step 3: Querying Messages
Step 4: Deleting Resources
User Guide
Usage Process Guide
Configuring Account Permissions
Creating the Cluster
Configuring the Namespace
Configuring the Topic
Configuring the Group
Connecting to the Cluster
Managing Messages
Managing the Cluster
Viewing Monitoring Data and Configuring Alarms
Cross-Cluster Message Replication
Use Cases
Naming Conventions for Common Concepts of TDMQ for RocketMQ
RocketMQ Client Use Cases
RocketMQ Performance Load Testing and Capacity Assessment
Access over HTTP
Client Risk Descriptions and Update Guide
Migration Guide for TencentCloud API Operations Related to RocketMQ 4.x Cluster Roles
Migration Guide
Disruptive Migration
Seamless Migration
Developer Guide
Message Types
Message Filtering
Message Retries
POP Consumption Mode (5.x)
Clustering Consumption and Broadcasting Consumption
Subscription Relationship Consistency
Traffic Throttling
​​API Reference(5.x)
History
API Category
Making API Requests
Topic APIs
Consumer Group APIs
Message APIs
Role Authentication APIs
Hitless Migration APIs
Cloud Migration APIs
Cluster APIs
Data Types
Error Codes
​​API Reference(4.x)
SDK Reference
SDK Overview
5.x SDK
4.x SDK
Security and Compliance
Permission Management
CloudAudit
Deletion Protection
FAQs
4.x Instance FAQs
Agreements
TDMQ for RocketMQ Service Level Agreement
Contact Us
문서TDMQ for RocketMQMigration GuideDisruptive MigrationMigrating Metadata from a Self-Built Cluster

Migrating Metadata from a Self-Built Cluster

PDF
포커스 모드
폰트 크기
마지막 업데이트 시간: 2026-01-23 17:36:45

Scenarios

When using TDMQ for RocketMQ, customers often face the challenge of migrating the existing business, for example, migrating business from self-built RocketMQ clusters or managed RocketMQ clusters on other platforms to TDMQ for RocketMQ.
This guide walks you through migrating metadata from a self-built open-source RocketMQ cluster to Tencent Cloud TDMQ for RocketMQ.
Note:
Both exclusive clusters and virtual clusters support metadata migration, and the migration steps are the same.

Prerequisites

You have created a cloud-based cluster and namespace in advance in the console.

Operation Steps

Step 1: Exporting the Metadata File

If you are using a self-built open-source edition of RocketMQ, we provide three methods to help you export metadata.

Method 1: Online Export Using Scripts

If your environment can access the public network, run the following script directly on your server (if your RocketMQ cluster consists of multiple machines, it can be run on any machine provided there is network connectivity within the cluster).
/bin/bash -c "$(curl -fsSL https://rocketmq-1306598660.cos.ap-guangzhou.myqcloud.com/rocketmq-export.sh)"

Method 2: Executing Scripts Locally

If your network environment does not have public network access permissions,
1. download the Cloud Migration Tool to a local directory.
2. Upload the downloaded tool to your self-built RocketMQ cluster. (If your RocketMQ cluster consists of multiple machines, it can be run on any machine provided there is network connectivity between the machines within the cluster.)
3. Decompress the package and enter the tool's directory.
unzip rocketmq-migration.zip
cd rocketmq-migration
4. Run the following commands to perform the migration.
// Run this command primarily to use the file from the export tool as the executable file.
ROCKETMQ_HOME=`pwd`
// Start export execution.
./bin/export.sh
// Enter the address of the open-source RocketMQ cluster that you want to export, such as localhost:9876.
Enter name server address list:localhost:9876
// Enter the name of the cluster that you want to export, such as DefaultCluster.
Choose a cluster to export:DefaultCluster
// Enter the metadata export directory. By default, the final metadata is stored in /tmp/rocketmq/config/rocketmq-metadata-export.json.
Enter file path to export [default /tmp/rocketmq/export]:

Method 3: Exporting and Importing an .xlsx File

If your metadata originates from another TDMQ for RocketMQ cluster on Tencent Cloud, you can directly upload topic and group data by using a .xlsx template.
Export metadata directly by clicking

in the upper-right corner of the Topic/Group list page. The exported metadata is in .xlsx format. Then, click

in the upper-right corner of the Topic/Group list page for the new cluster to import the data into the specified namespace of a 4.x cluster or under a 5.x cluster.
For newly created clusters, you can also edit the metadata in the spreadsheet according to the aforementioned .xlsx metadata template format and then upload it. Choose Migration to Cloud > Metadata Import, and you can obtain the template from the instructions on the right side. When obtaining the template, differentiate between metadata templates for 4.x clusters and 5.x clusters by selecting different types of target clusters.


Step 2: Creating a Migration Task

1. Log in to the TDMQ for RocketMQ console and go to the Migration to Cloud page. Go to the migration task list page. Click Create Task to create the corresponding migration task.
2. Select the migration task type:
Import to cluster: Migrate metadata from the original self-built cluster to the created cluster. When performing a cluster migration task, the migration tool by default parses the part before the percent sign (%) in the topic name from the open-source RocketMQ dashboard as the namespace name, thereby creating multiple logically isolated namespaces for you. If namespaces were not differentiated in the original self-built cluster, the system will generate a default namespace named default for you (applicable only to 4.x exclusive clusters and existing 4.x virtual clusters).
Import to specified namespace: supported only by 4.x exclusive clusters and existing 4.x virtual clusters. Migrate metadata from the original self-built cluster to the specified namespace. If topics were not previously differentiated by namespace or categorized by business, you can leverage the cloud migration opportunity. During the subsequent import process, select specific topics and groups and assign them to enter different namespaces to distinguish between businesses or environments.

Note:
5.x clusters and 4.x general clusters support importing roles and the access control list (ACL) information.
5.x clusters and 4.x general clusters do not have namespaces. Therefore, they only support importing to the cluster level, and there is no Import to Namespace option.
3. Upload the metadata file obtained in Step 1 according to the figure, and select the topics and groups to be imported.
Note:
A single task can import at most 1,000 topics and 1,000 groups. Any data beyond these limits will fail to be imported.


Step 3: Viewing the Task Status

After the task is created successfully, go to the task list to view the task progress. If there is too much data, the task may take some time to load. Click View Details to view the detailed running status of the task.

If the task status is Partially Failed or Completely Failed, you can filter to view the reasons for the failure.



도움말 및 지원

문제 해결에 도움이 되었나요?

피드백