When you migrate to a new ApsaraMQ for RocketMQ instance or replicate configurations across environments, manually recreating consumer groups is time-consuming and error-prone. The group data export and import feature lets you export group configurations from one instance as an .xlsx file and import them into another, automatically recreating groups with the same basic configuration.
Use cases
| Scenario | Description |
|---|---|
| Instance migration | Export group data from your current instance and import it into a newly purchased instance. Groups are automatically recreated with the same basic configuration. |
| Environment cloning | Replicate the same group setup across development, testing, and production instances without manually recreating each group. |
What gets exported
The export includes only group metadata:
Group IDs
Consumption policies
Group descriptions
Subscriptions and message data are not exported or migrated. Only basic group configuration is transferred between instances.
Cross-version compatibility
ApsaraMQ for RocketMQ 4.x and 5.x instances use different group metadata schemas. Review the compatibility rules before you start:
| Direction | Supported | Notes |
|---|---|---|
| 5.x to 4.x | Yes | Import directly. Only fields supported by 4.x take effect. See Step 5 of the import procedure for details. |
| 4.x to 5.x | Requires editing | Modify the exported file before importing. See Step 5 of the 5.x import procedure for required parameter changes. |
Export group data
Prerequisites
Before you begin, make sure that you have:
An ApsaraMQ for RocketMQ instance with existing consumer groups
Permissions to access the ApsaraMQ for RocketMQ console
Procedure
Log on to the ApsaraMQ for RocketMQ console. In the left-side navigation pane, click Instances.
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.
In the left-side navigation pane, click Groups.
In the upper-right corner of the Groups page, click the
icon.
The group data is saved as an .xlsx file to your local machine.
Import group data
You can import the exported file as-is, or edit it first to match your requirements.
Prerequisites
Before you begin, make sure that you have:
A group data .xlsx file (exported from another instance or created manually)
An ApsaraMQ for RocketMQ destination instance
Permissions to access the ApsaraMQ for RocketMQ console
Procedure
Log on to the ApsaraMQ for RocketMQ console. In the left-side navigation pane, click Instances.
In the top navigation bar, select a region, such as China (Hangzhou). On the Instances page, click the name of the destination instance.
In the left-side navigation pane, click Groups.
In the upper-right corner of the Groups page, click the
icon.Select the group data file from your local machine and click Open. The file must follow the parameter requirements listed below.
Parameter Description Requirements ConsumerGroupId The group ID. Letters, digits, underscores (_), and hyphens (-). Recommended prefix: GID_orGID-. Length: 2-64 characters.ConsumerGroupType The protocol used by the group. Create separate groups for HTTP and TCP clients. TCPorHTTPRemark A short description of the group. 1-60 characters. Example file content
ConsumerGroupId ConsumerGroupType Remark GID_test1 HTTP Used for HTTP clients. GID_test2 TCP Used for TCP clients. In the Import Resources panel, select the groups to import and click Confirm and Import in the Actions column. To import multiple groups at once, select them and click Batch Import.
Verify that the Execution Results column shows Imported for each group.
In the lower-left corner of the Import Resources panel, click OK to finish.
The imported groups now appear in the group list of the destination instance.
See also
Export and import topic data -- Synchronize topic configurations across instances.
Migrate self-managed Apache RocketMQ clusters to ApsaraMQ for RocketMQ instances -- Migrate from an open-source Apache RocketMQ deployment.