When you replace an 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 all groups with the same settings.
Only group metadata is exported: group IDs, delivery order types, retry policies, and descriptions. Subscriptions and message data are not exported or changed.
Use cases
Instance replacement: Export group data from the original instance and import it into a new instance. All groups are automatically recreated.
Environment cloning: Replicate group configurations across development, test, and production instances in a single import operation.
Cross-version compatibility
Group metadata differs between ApsaraMQ for RocketMQ 4.x and 5.x instances:
| Migration path | Action required |
|---|---|
| 5.x to 4.x | Import directly. Only specific fields take effect on the 4.x instance. |
| 4.x to 5.x | Before importing, update the parameters in the data file to match the 5.x format. See Parameter requirements. |
Export group data
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. All group data is exported from the instance and saved as an .xlsx file.
Import group data
You can import the exported file directly, or edit it first to update groups before importing.
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.Select the group data file from your local machine and click Open.
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. After each group is processed, its Execution Results column shows Imported.
In the lower-left corner of the Import Resources panel, click OK to complete the import. The imported groups now appear in the group list.
Parameter requirements
Each row in the import file must satisfy the following requirements.
| Parameter | Description | Valid values |
|---|---|---|
| ConsumerGroupId | Group ID. Letters, digits, underscores (_), and hyphens (-) only. 1 to 60 characters. Cannot contain system-reserved characters or special prefixes. See Limits on parameters. | Letters, digits, underscores, and hyphens |
| DeliveryOrderType | Message delivery order. See Ordered messages. | Concurrently (concurrent delivery) or Orderly (ordered delivery) |
| ConsumeRetryPolicy | Retry policy for failed message consumption. See Message retry. | FixedRetryPolicy (fixed-interval retry) or DefaultRetryPolicy (exponential backoff retry) |
| MaxRetryTimes | Maximum number of retries. | Less than or equal to 1,000 |
| DeadLetterTargetTopic | Destination topic for messages that exceed the retry limit. Source topics cannot serve as dead-letter topics. Leave blank to disable. See Dead-letter messages. | A valid topic name, or blank |
| Remark | Group description. | 1 to 60 characters |
Example data file
| ConsumerGroupId | DeliveryOrderType | ConsumeRetryPolicy | MaxRetryTimes | DeadLetterTargetTopic | Remark |
|---|---|---|---|---|---|
| testgroup1 | Orderly | FixedRetryPolicy | 16 | Used to subscribe to billing messages. | |
| testgroup2 | Concurrently | DefaultRetryPolicy | 16 | targettopic1 | Used to subscribe to logistics messages. |