There are three methods available to back up and restore Lighthouse settings and state:
1. VM snapshot or clone
Since Lighthouse is a virtual appliance, you may use its VM hypervisor's built-in capabilities to make a copy of the current Lighthouse instance.
This method saves both the configuration and the current running state of Lighthouse, for convenient rollback or migration to another VM hypervisor.
Please refer to your VM hypervisor's documentation for specific instructions.
2. Complete config tarball
This method takes a copy of all configuration files (the config overlay filesystem), providing a snapshot of the current system configuration but not its running state.
To back up configuration:
Note: The Lighthouse UI, API and config CLI (ogconfig-cli) will become unresponsive for several minutes during this process.
1. Login to the Lighthouse CLI as root, or as a Lighthouse Administrator user, run:
2. Run the following commands:
tarball="/tmp/$(hostname)-$(date +%Y%m%d%H%M%S)-backup.tar.gz" supervisorctl stop workers:*
supervisorctl stop wsapi-fcgi:* supervisorctl stop ogsearch-server:* supervisorctl stop ogconfig-srv:* tar zcf "$tarball" /mnt/config_overlay_upper/data supervisorctl start ogconfig-srv:* supervisorctl start ogsearch-server:* supervisorctl start wsapi-fcgi:* supervisorctl start workers:*
3. Copy the tarball to a secure offbox location, e.g.:
scp "$tarball" email@example.com:/target/path/ rm "$tarball"
To restore configuration:
Note: The Lighthouse UI, API and config CLI (ogconfig-cli) will become unresponsive for several minutes during this process after which Lighthouse will reboot and be unavailable for several minutes.
1. Copy the previously created tarball to Lighthouse's /tmp directory using scp, WinScp or similar.
2. Login to the Lighthouse CLI as root, or as a Lighthouse Administrator user, run:
3. Run the following commands:
supervisorctl stop workers:* supervisorctl stop wsapi-fcgi:* supervisorctl stop ogsearch-server:* supervisorctl stop ogconfig-srv:* killall mysqld_safe cd / tar zxvf /tmp/*-backup.tar.gz reboot
3. Configuration CLI commands
Using ogconfig-cli, Lighthouse's configuration CLI, advanced users may export a series of ogconfig-cli set commands that can be used to recreate the current configuration.
Warning: Care is advised when using this method, as currently, complete configuration restore is not reliably supported and partial configuration export may contain dangling references.
To begin, login to the Lighthouse CLI as root, or as a Lighthouse Administrator user run:
To export the entire configuration run:
ogconfig-cli -c 'export .'
To export partial configuration, e.g. all Smart Groups, run:
ogconfig-cli -c 'export smart_groups'
The lines that are output are commands that may be pasted into an interactive ogconfig-cli session, which is started with:
After pasting the commands, commit changes with:
Alternatively for automation and scripting, you may save the commands to a text file and pipe them through ogconfig-cli, e.g. to export:
ogconfig-cli -c 'export system.net' > /tmp/my-config echo 'push' >> /tmp/my-config
Then to restore:
cat /tmp/my-config | ogconfig-cli