How to backup & restore RHEV-M 3.0 to another system?

Solution Verified - Updated -

Environment

  • Red Hat Enterprise Virtualization 3.0

Issue

  • I want to backup and restore my RHEV-M to another system. How can I do this without losing data?
  • How do I prepare for catastrophic failures with RHEV?
  • How can I backup my RHEV-M to prepare for a migration to RHEV 3.1?

Resolution

Caution: RHEV-M FQDN(fully qualified domain name) should remain same on both setups - original and the new restored.

Backup RHEV
1) Backup the RHEV-M database:

# /usr/bin/pg_dump -C -E UTF8 --column-inserts --disable-dollar-quoting --disable-triggers -U postgres --format=p -f <FILENAME-SET-TO-DESIRED-NAME>.sql rhevm

Note: if you have rhevm-report and rhevm-report-dwh packages installed, you may like to backup those databases as well. If this is the case, please repeat the above command but replace 'rhevm' once with 'rhevm_history' and again with 'rhevmreports'

2) Backup the following configuration files and folders:

/etc/jbossas/jbossas.conf   
/etc/rhevm/                                   
/etc/yum/pluginconf.d/versionlock.list  
/etc/pki/rhevm/   
/etc/jbossas/rhevm-slimmed/     
/usr/share/rhevm-reports-server/buildomatic     
/usr/share/rhevm/conf/iptables.example  
/usr/share/rhevm/kerberos/krb5.conf     
/usr/share/rhevm/dbscripts/create_db.sh.log     
/usr/share/rhevm/rhevm.ear/rhevmanager.war/ExternalConfig.txt   
/usr/share/rhevm/rhevm.ear/rhevmanager.war/ServerParameters.js 
/usr/share/rhevm-reports/reports-INSERT_VERSION_NUMBER/resources/organizations/rhevmreports/Resources/JDBC/data_sources/rhevm.xml   
/usr/share/rhevm-reports/reports-INSERT_VERSION_NUMBER/users/rhevmreports/rhevm-002dadmin.xml   
/usr/share/rhevm-reports-server/buildomatic/default_master.properties   
/usr/share/rhevm-reports-server/buildomatic/install.xml     
/usr/share/rhevm-reports-server/buildomatic/setup.xml   
/root/.pgpass   
/root/.rnd

Note: if rhevm-reports are not installed, you may not have its files mentioned above.

3) Shut down the original RHEV-M

Restoring the RHEV-M
1) Boot the replacement system where RHEV-M will be installed
2) Install rhev-m:

# yum -y install rhevm

3) Run rhevm-setup

# rhevm-setup

4) Drop the existing database and create a new, blank database

Make sure jboss services are stopped before trying to drop database.

# psql -U postgres
postgres=# drop database rhevm;
postgres=# create database rhevm;
postgres=# \q

5) Restore the database that was backed up above

# psql -U postgres -d rhevm -f <FILENAME-SET-TO-DESIRED-NAME>.sql

6) Restore the files listed above from the backup made

7) Restore the above "configuration files and folders list" to their original locations and check the permissions.

8) Start the JBoss service:

# service jbossas start

Note, this is based on Administration Guide 15.1. Backup and Restore the rhevm Postgres Database.
Equivalent article for 3.1: How to backup & restore RHEV-M 3.1 to another system?

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments