Open NAC Core RestoreΒΆ

After passing through a higly critical hardware failure, we may need to recover the openNAC server from one of its previous backups.

Procedure:

  1. Recover the openNAC server by either:
    • Restoring its lastest snapshot from within your virtualizer;
    • Redeploying from a OVA with the same version or newer (If you had v1.0r5600, you should not use a v1.0r5500 for restoring);
  2. Stop all the services:
service httpd stop
service gearmand stop
service openNAC stop
  1. Unpack the backup tarball:

Note

Make sure that the mount point where you are extracting the files, have enough space to support the uncompressed files!!!

mkdir /tmp/restore
tar -xvzf opennac-opennac.tpl-20180226_232601.tgz -C /tmp/restore
cd /tmp/restore/
cd tmp/
gzip -d opennac-db-backup-*.sql.gz
  1. This is what we will get from the backup tarball:
[root@openNAC restore]# ls -l
drwxr-xr-x 96 root root 12288 Feb 23 03:25 etc
drwxr-xr-x  2 root root  4096 Feb 27 16:01 tmp
drwxr-xr-x  3 root root  4096 Feb 27 16:00 usr
drwxr-xr-x  3 root root  4096 Feb 27 16:00 var
[root@openNAC restore]# ls -l tmp/
-rw-r--r-- 1 root root 3107605 Feb 26 23:26 opennac-db-backup-v1.0.rc1.5913-20180226_232601.sql
  1. Restore openNAC data:
cd /tmp/restore
mv -rfv usr/share/opennac/usr/share/
mysql -u${mysql_root} -p${mysql_root_password} openNAC < tmp/opennac-db-backup*.sql
  1. Start services:
service openNAC start
service gearmand start
service httpd start