Automatic DB2 databases backup upon upgrade

You can configure your BigFix Server to automatically run the backup of the BFENT and BESREPOR databases before and after running the upgrade process.

Enabling the feature

To enable this behavior you must assign an existing path, accessible both by root and by the database instance owner, by default db2inst1, to the advanced option automaticBackupLocation, for example:
/opt/BESServer/bin/BESAdmin.sh -setadvancedoptions 
    -sitePvkLocation=<pvkLocation>  -sitePvkPassword=<pvkPassword> 
    -update automaticBackupLocation="/my/path"

This behavior applies both when you run the upgrade from the command line and when you run the upgrade by deploying the upgrade Fixlet.

Two backups are generated for each of the BFENT and BESREPOR databases during this process, one before the upgrade and one after the upgrade, for a total of four backups. The files containing the backups are stored in the directory that you specified in the automaticBackupLocation advanced option.
Note: Ensure that there is enough disk space available on the file system to store the four backup files.
These are sample backup files generated during the upgrade:
BFENT.0.db2inst1.DBPART000.20160711142219.001
BESREPOR.0.db2inst1.DBPART000.20160711142240.001

BFENT.0.db2inst1.DBPART000.20160711142306.001
BESREPOR.0.db2inst1.DBPART000.20160711142327.001
The fifth digit in the file name is a time stamp. For example, 20160711142219 in the first file means 2016-07-11 at 14:22:19.

In the installation log BESInstall.log you can see the time stamp of each database backup along with the information about whether the backup was generated before or after the upgrade.

Troubleshooting the feature

If one of the initial backup fails, the upgrade process fails. Investigate what prevented the backup from running and rerun the upgrade.

If one of the two final backups fails, the BigFix server is upgraded successfully and you get a warning message informing you that one of the two final backups failed. Investigate what prevented the backup from running and rerun the backup of the database manually.

You find the information about the backup failure in the /var/log/BESAdminDebugOut.txt file.

Disabling the feature

If you want to disable the automatic backup feature, run the command:
/opt/BESServer/bin/BESAdmin.sh -setadvancedoptions 
    -sitePvkLocation=<pvkLocation> -sitePvkPassword=<pvkPassword> 
    -delete automaticBackupLocation