This topic describes how to create a migration task in the Message Queue for Apache RocketMQ console.

Background information

Message Queue for Apache RocketMQ provides a metadata export tool that allows you to export the metadata of open source RocketMQ clusters as a JSON file. Before you migrate an open source RocketMQ cluster to Alibaba Cloud, you need to export the cluster metadata as a file by following the steps in Preparations, and upload the file in the Message Queue for Apache RocketMQ console.

Preparations

Use the metadata export tool to export the metadata of the open source RocketMQ cluster as a file.

You can choose one of the following methods provided by Message Queue for Apache RocketMQ to export the metadata based on the network type of the open source RocketMQ server.
  • Method 1: Download the script of the metadata export tool, upload the script to the RocketMQ server, and then run the following command:
    ./bin/export.sh

    Procedure: Download the script → Upload the script to the server → Run the ./bin/export.sh command

  • Method 2: If the RocketMQ server can be accessed over the Internet, run the following command:
    /bin/bash -c "$(curl -fsSL https://ons-migration.oss-cn-hangzhou.aliyuncs.com/export.sh)"

Procedure of method 1

  1. Download the metadata export tool by clicking rocketmq-for-export.tar.gz.
  2. Upload the tool to the open source RocketMQ server.
  3. Run the ./bin/export.sh command in the directory in which the tool resides to start the tool.
  4. Specify the address of the open source RocketMQ server, the name of the cluster whose metadata you want to export, and the path to store the exported file.
    // Enter the address and port number of the open source RocketMQ server. The port number is fixed to 9876. 
    Enter name server address list: example.net:9876
    // Enter the name of the open source RocketMQ cluster whose metadata you want to export. 
    Choose a cluster to export: DefaultCluster
    // Enter the path to store the exported file. If no path is not specified, the file is stored under the default path /tmp/rocketmq/config.  
    Enter file path to export [default /tmp/rocketmq/export]:
    The metadata is exported as expected if the following information is returned:
    [INFO] The RocketMQ metadata has been export to the file:/tmp/rocketmq/config/rocketmq-metadata-export.json

Procedure of method 2

  1. Run the following command on the open source RocketMQ server to download and start the metadata export tool.
    Note Do not change the https://ons-migration.oss-cn-hangzhou.aliyuncs.com path that is used to store the script in the command.
    /bin/bash -c "$(curl -fsSL https://ons-migration.oss-cn-hangzhou.aliyuncs.com/export.sh)"
  2. Specify the address of the open source RocketMQ server, the name of the cluster whose metadata you want to export, and the path to store the exported file.
    // Enter the address and port number of the open source RocketMQ server. The port number is fixed to 9876. 
    Enter name server address list: example.net:9876
    // Enter the name of the open source RocketMQ cluster whose metadata you want to export. 
    Choose a cluster to export: DefaultCluster
    // Enter the path to store the exported file. If no path is not specified, the file is stored under the default path /tmp/rocketmq/config.  
    Enter file path to export [default /tmp/rocketmq/export]:
    The metadata is exported as expected if the following information is returned:
    [INFO] The RocketMQ metadata has been export to the file:/tmp/rocketmq/config/rocketmq-metadata-export.json

Create a migration task

  1. Log on to the Message Queue for Apache RocketMQ console.
  2. In the left-side navigation pane, click Migration to Cloud.
  3. In the top navigation bar, select a region, such as China (Hangzhou).
  4. On the Migration to Cloud page, click Create Task in the upper-left corner.
  5. Complete the Create Task wizard and click Next.
    1. Enter the name of the migration task in the Task Name field.
      Note The name must be 3 to 64 characters in length and can contain only letters, digits, hyphens (-), and underscores (_).
    2. Click the Click to upload a metadata file button next to the Metadata parameter and select the exported metadata JSON file. For more information about how to export metadata, see Preparations.

What to do next

Step 2: Evaluate whether migration conditions are met