All Products
Search
Document Center

ApsaraMQ for RocketMQ:Export and import group data

Last Updated:May 24, 2024

ApsaraMQ for RocketMQ allows you to export the group data of an instance and then import the data to another ApsaraMQ for RocketMQ instance. When you change or clone an instance, you can use the group data export and import feature to quickly create groups that have the same basic information as the groups on the original instance.

Background information

You can use the group data export and import feature in the following scenarios:

  • Change an instance

    If the ApsaraMQ for RocketMQ instance that you use cannot meet your business requirements, you can purchase a new instance and use this feature to export the group data of the original instance and then import the data to the new instance. This way, the groups that you use on the original instance are automatically created on the new instance.

  • Clone an instance

    You can use this feature when you deploy different ApsaraMQ for RocketMQ instances and want your business to access the same groups in development, test, and production environments. In this case, you can create the related groups on one of the deployed instances, use the group data export and import feature to export the group data, and then import the data to another instance to quickly create the same groups on the existing instance.

Usage notes

  • The group metadata of ApsaraMQ for RocketMQ 4.x instances is different from that of ApsaraMQ for RocketMQ 5.x instances. When you export and import group data, take note of the following items:

    • You can directly import the group data of an ApsaraMQ for RocketMQ 5.x instance to an ApsaraMQ for RocketMQ 4.x instance. After you import the group data, only specific fields in the imported file take effect. For more information, see Step 5 of the "Import group data" section of this topic.

    • You cannot directly import the group data of an ApsaraMQ for RocketMQ 4.x instance to an ApsaraMQ for RocketMQ 5.x instance. Before you import the data, you must modify the parameters in the group data file to be imported based on the description in Step 5 of the "Import group data" section of the Import and export group data topic.

  • When you export and import group data, only basic information about the groups is exported and imported, such as the group IDs, the consumption policies of the groups, and the description of the groups. Subscriptions and message data are not changed or migrated.

  • When you import group data, the values of the parameters in the file that you want to import must meet the requirements that are specified in Step 5 of the "Import group data" section of this topic.

Export group data

  1. Log on to the ApsaraMQ for RocketMQ console. In the left-side navigation pane, click Instances.

  2. In the top navigation bar, select a region, such as China (Hangzhou). On the Instances page, click the name of the instance that you want to manage.

  3. In the left-side navigation pane, click Groups.

  4. In the upper-right corner of the Groups page, click the 导出 icon.

    The system exports the group data of the instance and saves the data to an .xlsx file.

Import group data

You can directly import the exported group data to the destination instance. You can also update the exported group data based on your business requirements before you import the data to the destination instance. To import the group data to the destination instance, perform the following steps:

  1. Log on to the ApsaraMQ for RocketMQ console. In the left-side navigation pane, click Instances.

  2. In the top navigation bar, select a region, such as China (Hangzhou). On the Instances page, click the name of the instance that you want to manage.

  3. In the left-side navigation pane, click Groups.

  4. In the upper-right corner of the Groups page, click the 导入 icon.

  5. Select the group data file that you saved on your on-premises machine and click Open.

    The following table describes the requirements on the values of parameters in the group data file to be imported.

    Parameter

    Description

    Valid value

    ConsumerGroupId

    The group ID.

    • The group ID can contain letters, digits, underscores (_), and hyphens (-). We recommend that you start the group ID with "GID_" or "GID-".

    • The group ID must be 2 to 64 characters in length.

    ConsumerGroupType

    The protocol that is used by the group.

    ApsaraMQ for RocketMQ allows you to send and receive messages by using HTTP and TCP clients. You must create different groups for clients of different types. For example, if you want to send and receive messages by using a TCP client SDK, you must create a group that uses the TCP protocol.

    Valid values:

    • TCP

    • HTTP

    Remark

    The group description.

    The group description must be 1 to 60 characters in length.

    Example:

    ConsumerGroupId

    ConsumerGroupType

    Remark

    GID_test1

    HTTP

    Used for HTTP clients.

    GID_test2

    TCP

    Used for TCP clients.

  6. In the Import Resources panel, select the group whose data you want to import and click Confirm and Import in the Actions column.

    You can also select multiple groups and click Batch Import.

    After you import the group data, the values in the Execution Results column of the group list change to Imported.

  7. In the lower-left corner of the Import Resources panel, click OK to complete the import operation.

    After the group data is imported, the groups whose data is imported appear in the group list.

References