In this blogpost i will show you how to backup and restore your active RabbitMQ configuration.
This is only the configuration no definitions or messages will be backed-up or restored.
Prerequisites
To be able to backup or restore a RabbitMQ configuration you will need to get command line tool rabbitmqadmin.
First check if rabbitmq_managment is enabled on one of your RabbitMQ nodes:
rabbitmq-plugins enable rabbitmq_management
After that you will be able to download rabbitmqadmin on the RabbitMQ node with the following command:
wget https://{rabbitmq-node-hostname}:15672/cli/
Once downloaded, make the file executable and move it to the /usr/local/bin
directory on the RabbitMQ node:
chmod +x rabbitmqadmin
sudo mv rabbitmqadmin /usr/local/bin
Backup
To backup the RabbitMQ instance configuration, use the following command:
rabbitmqadmin export <configuration-backup-file-name.json>
Result example:
Exported definitions for localhost to "configuration-backup-test.json"
Restore
To restore the RabbitMQ instance configuration, user the following command:
rabbitmqadmin import <configuration-backup-file-name.json>
Result example:
Imported definitions for localhost from "configuration-backup-test.json"