Directly contact our Support Team

How to restore a GravityZone database backup

Bitdefender GravityZone provides full visibility into organizations' overall security posture, global security threats, and control over its security services that protect virtual or physical desktops, servers and mobile devices. All Bitdefender's Enterprise Security solutions are managed within the GravityZone through a single console, Control Center, that provides control, reporting, and alerting services for various roles within the organization.
When from various reasons your GravityZone instance is working improperly (failed updates, dysfunctional interface, corrupted files, errors, etc.), you can restore the GravityZone database from a backup copy.

Restoring the database to the same GravityZone VA

Prerequisites

  • A SSH connection to the GravityZone appliance, using root privileges.
    You can use putty and bdadmin's credentials to connect to the appliance via SSH, then run the command sudo su to switch to the root account.
  • The GravityZone infrastructure has not changed since the backup.
  • The backup is more recent than April 30th, 2017 and the &gravity; version is higher than 6.2.1-30. If otherwise, contact the Technical Support team.
  • In distributed architectures, GravityZone has not been configured to use database replication (Replica Set).
    To verify the configuration, follow these steps:
    1. Open the /etc/mongodb.conf file.
    2. Check that replSet is not configured, as in the example below:
      # replSet = setname
  • No CLI processes are running.
    To make sure all CLI processes are stopped, run the following command:
    # killall -9 perl
  • The mongoconsole package is installed on the appliance.
    To verify the condition is met, run this command:
    # /opt/bitdefender/bin/mongoshellrestore --version
    The command should not return any errors, otherwise run:
    # apt-get update
    # apt-get install --upgrade mongoconsole

Restoring the database

  1. Go the the location containing the database archive:
    # cd /directory-with-backup
    Where directory-with-backup is the path to the location with the backup files.
    For example:
    # cd /tmp/backup
  2. Restore the database.
    /opt/bitdefender/bin/mongoshellrestore -u bd -p 'GZ_db_password' --authenticationDatabase admin --gzip --drop --archive < 'gz-backup-$YYYY-$MM-$DD(timestamp).tar.gz'
    important Important:
    Make sure to replace GZ_db_password with the actual password of the GravityZone Database Server and the timestamp variables in the archive's name with the actual date.
    For example, the actual date should look like this:
    gz-backup-2019-05-17(1495004926).tar.gz
  3. Restart the appliance.
    Database restoration is now complete.

Restoring the database from a decommissioned GravityZone VA

Prerequisites

  • A fresh GravityZone VA installation, with the same IP as the old appliance and having only the Database Server role installed. You can download the GravityZone VA image from here.
  • A SSH connection to the GravityZone virtual appliance, using the root privileges.
  • The GravityZone infrastructure has not changed since the backup was made.
  • The backup is more recent than April 30th, 2017.
  • In distributed architectures, GravityZone has not been configured to use database replication (Replica Set). If you use Replica Set in your GravityZone environment, you also have the Database Server role installed on other appliance instances.

Restoring the database

  1. Download the Virtual Appliance.
  2. Install the database role:
    # dpkg -l gz*
    # dpkg -l mongo*
  3. Stop VASync:
    # service vasync stop
  4. Stop CLI:
    # killall -9 perl
  5. Go the the location containing the database archive:
    # cd /directory-with-backup
    Where directory-with-backup is the path to the location with the backup files.
    For example:
    # cd /tmp/backup
  6. Restore the database:
    /opt/bitdefender/bin/mongoshellrestore -u bd -p 'GZ_db_password' --authenticationDatabase admin --gzip --drop --archive < 'gz-backup-$YYYY-$MM-$DD(timestamp).tar.gz'
    important Important:
    Make sure to replace GZ_db_password with the actual password of the GravityZone Database Server and the timestamp variables in the archive's name with the actual date.
    For example, the actual date should look like this:
    gz-backup-2019-05-17(1495004926).tar.gz
  7. Restore the appliance ID:
    /opt/bitdefender/bin/mongoshell -u bd -p 'GZ_db_password' --eval 'print(db.applianceInstalls.findOne({name:"db"}).applianceId);' --quiet devdb > /opt/bitdefender/etc/applianceid
    important Important:
    Make sure to replace GZ_db_password with the actual password of the GravityZone Database Server.
  8. Remove the reference to the old roles:
    /opt/bitdefender/bin/mongoshell -u bd -p 'GZ_db_password' --eval 'db.applianceInstalls.remove({ip:db.applianceInstalls.findOne({name:"db"}).ip,name:{"$ne": "db"}});' --quiet devdb
    important Important:
    Make sure to replace GZ_db_password with the actual password of the GravityZone Database Server.
  9. Start VASync:
    # service vasync start
  10. Start CLI:
    /opt/bitdefender/eltiw/installer
  11. Install the roles from the CLI:
    # dpkg -l gz*
    Note that the database schema has been successfully upgraded to the latest version:
    > db.settings.findOne().database
    {
    "previousVersion" : "000-002-009",
    "ranCleanUpVersions" : {
    "b0469c84f5bf0bec0b989ae37161b986" : "000-002-008"
    },
    "updateInProgress" : false,
    "updateTimestamp" : 1456825625581,
    "version" : "000-002-011"
    }
  12. Restart the appliance.
    Database restoration is now complete.

Restoring the database in a Replica Set environment

If you have deployed the database in a Replica Set environment, you can find the official restore procedure on the mongoDB online manual (English only).

Note: The procedure requires advanced technical skills and should be done only by a trained engineer. If you encounter difficulties, please contact our Technical Support to assist you in restoring the database.
 

Can't find a solution for your problem? Open an email ticket and we will answer the question or concern in the shortest time possible.

Rate this article:

Submit