How to restore Log DB via CLI in ClearPass (usually after a upgrade)?
We can restore the Log DB post upgrade to save time in the upgrade process. From CLI we can issue the following commands to restore the Log DB backup
This process needs to be repeated on each server in the cluster that should retain the session log database.
The restore command syntax is as follows:
restore user@hostname:/<backup-filename> [-l] [-i] [-b] [-c] [-r] [-n|-N] [-s]
restore http://hostname/<backup-filename>[-l] [-i] [-b] [-c] [-e] [-n|-N] [-s]
restore <backup-filename> [-l] [-i] [-b] [-c] [-r] [-n|-N] [-s]
-b -- do not backup current config before restore
-c -- restore CPPM configuration data
-l -- restore CPPM session log data as well if it exists in the backup
-r -- restore Insight data as well if it exists in the backup
-i -- ignore version mismatch and attempt data migration
-n -- retain local node config like certificates etc. after restore (default)
-N -- do not retain local node config after restore
-s -- restore cluster server/node entries from backup.
The node entries will be in disabled state on restore
The restoration process could take several hours depending on the size of your session log database. All services are accessible and handling requests during the restoration, but there will be a performance impact while the restoration is in progress.
We recommend that you perform this operation during a planned change window.
To restore the Log Database after the upgrade process is complete, use the restore command. Go to Administration > Server Manager > Local Shared Folders and download the upgrade-backup.tar.gz file.
Host the file at an scp or http location accessible from the ClearPass server and execute the command
restore <location/upgrade-backup.tar.gz> -l –i –b
In CLI, post restore successfully finished, you would see the following output
[appadmin@AJ-Lab-2]# restore db-backup-2016-02-26-07-11-31.tar.gz -l -i -b (here i stored the file locally on the server)
INFO - Restore started for AppPlatform databases
INFO - Restore complete for AppPlatform databases
INFO - Restore started for PolicyManager databases
INFO - Compressed database size for tipsLogDb: 1.56 MB
INFO - Database size after restore for tipsLogDb: 21 MB
INFO - Restore complete for PolicyManager databases
INFO - Restore complete.
Similar confirmation can be seen in the GUI as well