Backing-up, recovering from disaster, and rolling back
It's best practice to create a snapshot of Unravel Server and to test your snapshot on a failover server daily or at a minimum, weekly. It's essential to create a snapshot before any upgrade in case you need to revert to the previous Unravel version.
Creating a snapshot of Unravel Server
A snapshot includes state and databases. You create a snapshot by running the dump_unravel.sh
script:
sudo /usr/local/unravel/bin/dump_unravel.sh destination-dir
This script creates a subdirectory under destination-dir
named unravel_yyyymmddthhmmz
that contains the snapshot. The snapshot is suitable for a complete re-installation, if needed.
Writing the snapshot dump could take 5 minutes per GB, depending on the speed of your disks. During this time, Unravel Server is unavailable.
Warning
dump_unravel.sh
only backs up the database from a MySQL that is co-located on Unravel Server. If you use an external database, this script doesn't back that up; you need to do that yourself.
Loading a saved state
You can load a saved state into Unravel Server by specifying a source directory, source-dir
, to the load_unravel.sh
script. This script replaces the current Unravel Server state with the state in the source directory.
This operation wipes out existing data in Unravel Server. Data in an external database is unaffected.
The version of Unravel Server in the source directory should not be too different from the version of Unravel Sever currently running: major and minor versions must match. If your restore version differs significantly, contact Unravel Support.
sudo /usr/local/unravel/bin/load_unravel.sh source-dir
load_unravel.sh
replaces current state of the Unravel Server on the current host with the contents of source-dir
.
Recovering from disaster
For disaster recovery, you can prepare a cold failover or alternate server, and periodically update it with a snapshot. In this case, you would create a snapshot periodically on your normally live Unravel Server, and load that snapshot onto your alternate server. For a cold failover (to the alternate server), there is no need to start all the Unravel daemons until switching over-in other words, after the disaster in the normal data center.
Reverting to a prior version
It's best practice to execute rolling upgrades of Unravel Server: first upgrade the normal server, then upgrade the alternate server. That way you can always completely revert an upgrade to the prior version. To revert, do the following steps.
Warning
If you use an external database in production, you cannot revert it with this procedure; you might need to revert it separately.
Create a snapshot (saved state).
Dump Unravel Server state to
destination-dir
before upgrade.sudo /usr/loal/unravel/bin/dump_unravel.sh
destination-dir
Note the backup subdirectory created. For example,
/unravel_yyyymmddthhmmZ/
.
(Optional) Revert to the previous version of Unravel Server.
Stop Unravel Server:
/etc/init.d/unravel_all.sh stop
Uninstall the RPM:
rpm -e unravel
This command's output is a list of all data files.
Remove all data files listed in the output of the rpm -e command.
Install the previous version of Unravel Server:
rpm -U unravel*rpm*
Load the snapshot (saved state) you saved in
destination-dir
.For example,
/usr/local/unravel/bin/load_unravel.sh
destination-dir
/unravel_yyyymmddthhmmZ
/Start Unravel Server:
/etc/init.d/unravel_all.sh start