As part of a comprehensive backup strategy, take periodic backups of the TeamForge EventQ database
and RabbitMQ configuration.
Once you have created a snapshot of your TeamForge EventQ system files, you can use this process
to create periodic backups of the database and RabbitMQ configuration in order to restore data after a disaster.
It is important to backup RabbitMQ configuration frequently as new users are created each time a source
is created in TeamForge EventQ. This process does not require the shutdown of any services.
Backing up data
-
Run the following command to get the database name.
- grep database
/opt/collabnet/eventq/config/defaults.yml
-
To back up data from the DB server, use the mongodump
utility:
cd /opt/collabnet/mongodb sudo ./bin/mongodump -u backup -p
<password> -d
<database
name>
The MongoDB backup user password is located in:
/opt/collabnet/mongodb/.mongo_passwords
This will create a dump directory with an EventQ directory
inside which contains the database backup dump file.
-
Backup RabbitMQ user and configuration data using
rabbitmqadmin utility.
cd
/opt/collabnet/rabbitmq/var/lib/rabbitmq/rabbit@localhost-plugins-expand/rabbitmq_management-3.1.0/priv/www/cli/
sudo chmod +x rabbitmqadmin sudo ./rabbitmqadmin -u guest -p <password>
export <filename>
Only the guest user has permissions to backup RabbitMQ. The RabbitMQ guest
user password is located in:
/opt/collabnet/rabbitmq/.rabbit_passwords
Execution of this command requires Python 2.x, minimum 2.6 (Python 3.0 is not
supported).
RabbitMQ must be running when you use the rabbitmqadmin command.
You may wish to copy or softlink this script to a more accessible location,
see
http://www.rabbitmq.com/management-cli.html.
This script will output a file containing backup data regarding Users,
Vhosts, User Persmissions, Queue information, and various parameters,
policies, exchanges and bindings for advanced RabbitMQ configuration. Note,
queued messages are not backed up.
Restoring from data backup
-
To restore data to the DB server, use the mongorestore
utility:
cd /opt/collabnet/mongodb sudo ./bin/mongorestore -u backup -p
<password> -d eventq --drop dump/eventq/
This will restore MongoDB's EventQ database using the data contained in
the database dump. The --drop parameter will remove your
existing EventQ database before restoring the backup.
-
To restore RabbitMQ configuration, use the rabbitmqadmin
utility:
cd
/opt/collabnet/rabbitmq/var/lib/rabbitmq/rabbit@localhost-plugins-expand/rabbitmq_management-3.1.0/priv/www/cli/
./rabbitmqadmin -u guest -p <password> import
<filename>
Where <filename> is replaced by your exported RabbitMQ configuration file.
The RabbitMQ guest user password is located in:
/opt/collabnet/rabbitmq/.rabbit_passwords
Your RabbitMQ configuration will be restored.