This document describes how to migrate metadata from open-source RabbitMQ to TDMQ for RabbitMQ.
Before the metadata import, you need to first export the metadata file from open-source RabbitMQ. For metadata file export instructions, see Export open-source RabbitMQ metadata.
Open the terminal.
Enter the command below to export the metadata file from open-source RabbitMQ.
Export the metadata of all vhosts:
wget http://<Open-source RabbitMQ IP address>:15672/api/definitions --user <Open-source RabbitMQ username> --password <Open-source RabbitMQ password> -O <Metadata file storage path>
Export the metadata file of a specified vhost:
wget http://<Open-source RabbitMQ IP address>:15672/api/definitions/<Vhost name> --user <Open-source RabbitMQ username> --password <Open-source RabbitMQ password> -O <Metadata file storage path>
Currently, TDMQ for RabbitMQ doesn’t support the slash character “/”, but you don’t need to modify the metadata in case of such characters because TDMQ for RabbitMQ will escape the names that contain “/” when you import the metadata. The escape rules are as follows:
The default RabbitMQ vhost name that starts with “/” will be renamed “__default_vhost__”. For other vhost names that start with “/”, the slash character will be deleted and other characters will be retained.
|Task Type||Select either “Cluster migration” or “Vhost import”. If you select the former, the metadata of all the open-source RabbitMQ vhosts will be imported. If you select the latter, the metadata of a single vhost will be imported.|
|Cluster||Select a target cluster that is to be imported. You can select an existing cluster or create a new one.|
|Vhost Name||This field is required if the task type is “Vhost import”.|
|Message TTL||This field specifies the ACK timeout of an unconsumed message. If the task type is “Cluster migration”, the metadata of all vhosts will be imported, and the message TTL will be applied to all the imported vhosts. To modify this field, you can select a cluster on the Cluster page, click the Vhost tab, and click Edit in the Operation column.|
|Metadata File||Select and upload a metadata file exported from open-source RabbitMQ. The file content can be modified in the editing box. For more information on the file format, see Metadata file format description.|
Only one migration task can be executed in a TDMQ for RabbitMQ cluster at a time, that is, a new task can be created only after the last task is finished.
|Migrating||The metadata file is being migrated.|
|The metadata files of all vhosts have been successfully migrated.|
|Failed||The metadata file of a single vhost failed to imported (for the “Vhost import” task type); or the metadata files of all vhosts failed to be imported (for the “Cluster migration” task type).|
|Some failed||The metadata files of some vhosts failed to be imported (for the “Cluster migration” task type).|
|Timed out||The metadata file import timed out.|
|Task type||Cluster migration||Vhost import|
|Field requirement||The metadata file must contain the vhost list. Besides, the exchange, queue, and binding lists must contain the "vhost" field.|
|Naming convention||The vhosts, exchanges, queues, and bindings must be named in compliance with the naming conventions in TDMQ for RabbitMQ. For details, see Use Limits||The exchanges, queues, and bindings must be named in compliance with the naming conventions in TDMQ for RabbitMQ. For details, see Use Limits|
|Export method of open-source RabbitMQ metadata file||On the Overview tab page in the RabbitMQ console, click Export definitions and select All for the Virtual host field to export the metadata of all vhosts. If you want to exclude some vhosts from the migration task, delete them in the vhost list before the cluster migration.||On the Overview tab page in the RabbitMQ console, click Export definitions and select a specific vhost for the Virtual host field to export its metadata.|
The table below describes whether TDMQ for RabbitMQ is compatible with open-source RabbitMQ metadata:
|rabbitmq_version||Cluster version of open-source RabbitMQ.||No|
|users||User information of open-source RabbitMQ.||No|
|vhosts||Vhost list in open-source RabbitMQ||Yes. However, the default open-source RabbitMQ vhost named “/” will be automatically renamed “__default_vhost__” according to the naming conventions in TDMQ for RabbitMQ.|
|permissions||An open-source RabbitMQ user’s vhost management permissions.||No|
|parameters||Runtime parameters of open-source RabbitMQ.||No|
|global_parameters||Global parameters of open-source RabbitMQ.||No|
|policies||Optional parameters that open-source RabbitMQ sets for a vhost’s queues or exchanges, such as TTL and queue length limit.||No. If you want to use these optional parameters, you can go to the TDMQ for RabbitMQ console to edit them, or delete them and create new ones in the editing box on the Create Migration Task page.|
|queues||Open-source RabbitMQ queues.||Yes|
|exchanges||Open-source RabbitMQ exchanges.||Yes|
|bindings||Open-source RabbitMQ bindings.||Yes|