12.20. Backup and Restore¶
In the v4.4.5 release and beyond, there is a preferred method for creating backups. Using the dr-waltool program, a incremental backup can be done on a running system.
This backup can be used for archival purposes, restoration on failure, or movement of DRP from one machine to another.
To generate a back-up, you will need the architecture appropriate dr-waltool on the system that will receive the backup. dr-waltool runs on linux/amd64 or darwin/amd64. It may work on windows/amd64, but it has not been tested.
With dr-waltool in your path, you can do the following to backup a running DRP endpoint. dr-waltool respects the same environment variables as drpcli. It does not follow the .drpclirc or same command line flags. See dr-waltool –help for more information.
export RS_ENDPOINT=https://DRP_IP:DRP_PORT # FILL THIS IN export RS_KEY=username:password # FILL THIS IN dr-waltool backup --destDir=path/to/backup --artifacts
This will connect to the DRP Endpoint at address DRP_IP on port DRP_PORT using the username and password of username and password, respectively.
It will attempt to use the specified directory, path/to/backup, and create it if not present.
Since –artifacts was specified, all content packs, plugin providers, and the files and isos directories will be recorded as well. If –artifacts is not specified, only the data objects will be backed up.
You can also specify the endpoint and credentials on the command line with the –endpoint and either the –token or –key flags.
This is an incremental backup. The first one can take a long time as all the artifacts are synchronized. Running the command again on the same directory will on retrieve differences.
Once complete, this directory can be tarred up for storage elsewhere.
cd path/to/backup tar -zcvf ../backup-2020-08-25.tgz *
A complete backup would include the install.sh, dr-provision.zip, and this tarball as well.
To restore a backup on an running system, you will need to stop DRP, extract the backup into the active directories for the system, and restart DRP.
An example of this for a production installed system would like like this.
# Assumes this is running on a systemd-based linux server # Assumes that backup tarball is in /root and named backup-2020-08-25.tgz systemctl stop dr-provision cd /var/lib/dr-provision rm -rf /var/lib/dr-provision/* # To make sure nothing remains. tar -zxvf /root/backup-2020-08-25.tgz cd - systemctl start dr-provision
This will restart dr-provision at the previous state.
The rm is for completeness. If you are just restoring a database, then you only need to remove the /var/lib/dr-provision/wal, /var/lib/dr-provision/secrets, and /var/lib/dr-provision/digitalrebar directories.
12.20.4. Rebuild / Move¶
To move a system or rebuild a system, you will need to install the version of DRP you want. This should be the same or newer version than your backup. Do your installation as before. Once it is installed, you should follow the Restore procedure.
When moving an existing system, you should turn off the Subnets on the previous system before starting the new DRP endpoint. Duplicate Subnets can cause networking problems.