Backup and restore
The docker setup of BlueRange comes with two scripts that ease saving the database content and server configuration into a single file. The backup script can be executed periodically using e.g. cron. The archive created then just needs to be moved to some permanent storage such as S3 or onto a network share.
Backup of BlueRange
To create a backup of your installation run bluerange-backup.sh as root:
$ ./bluerange-backup.sh
| The backup script assumes the server is up and running. As the process may take awhile to complete it is recommended to create backups during idle times. |
In the example above the script created the file backup/bluerange-<YYYYMMDD_HHMMSS>.tar.gz. At the simplest, the entire backup folder is synced elsewhere.
Restoring the installation
In the event of disaster the machine is recovered by cloning a fresh working copy of the docker setup. Then run bluerange-restore.sh passing the backup archive file as an argument:
$ ./bluerange-restore.sh backup/bluerange-<YYYYMMDD_HHMMSS>.tar.gz
All existing BlueRange server data will be erased!
Are you sure to restore from bluerange-<YYYYMMDD_HHMMSS>?
Type YES: YES
YES
[...]
* ./bluerange-compose.sh to start the server...
Once complete the database content and the configuration data incl. certificates is restored.
| The restore tears down and erases all existing data! When reanimating a broken server it is strongly adviced to create a fresh backup even of the broken state. |
To recover operation of the server the bluerange-compose.sh must be ran once. This returns services into operation and installs them such that they are restarted automatically on system reboots. Please notice that the entire BlueRange system resumes operation immediately which may have side-effects on IoT devices installed into the building.