RabbitMQ : how to create and restore backup
18,449
Solution 1
If you have the management plugin installed you can back-up and restore the broker on the Overview page. At the bottom you will see Import/Export Definitions and you can use this to download a JSON representation of your broker.
This will restore Exchanges, Queues, Virtual Hosts, Policies and Users.
Hope that helps.
Solution 2
For those looking for the HTTP API endpoint, it is:
http://rabbit:15672/api/definitions
Another way to automate this is to use the command line tool rabbitmqadmin
(http://rabbit:15672/cli/) add pass the export
subcommand, e.g.
rabbitmqadmin export rabbit-backup.config
Related videos on Youtube
Author by
lior
Updated on June 04, 2022Comments
-
lior almost 2 years
I'm new to RabbitMQ and i need some help. how to do backup and restore to RabbitMQ, and what is the important data i need to save.
thanks!
-
lior over 10 yearssounds good but is it possible to do this automatically? to schedule an import?
-
Pandalover almost 10 yearsDid you ever find a solution to this?
-
Gabriele Santomaggio over 9 years@lior the management plug-is has the HTTP API, so you can create an script in python or java or what you prefer to schedule and export the configurations
-
Mikhail over 8 yearsbut this dont back-up data from queue
-
nelsonenzo over 6 yearsthis just exports the configurations, not the data.
-
higuita over 5 yearsTo backup data, you need to have more than one host and set a policy to "mirror the queues and exchanges", using
ha-mode: nodes ha-sync-mode: automatic ha-params: rabbit@rabbitmq-01 rabbit@rabbitmq-02
and apply then to all queues and exchanges. Now you have a online backup, to move that to offline backup, probably the best way is to stop that extra node rabbitmq, backup the disk and start it again. It will recover the offline time from the other node after the startup