System Backup and Restore
About System Backup and Restore
GroundWork Monitor 8 is comprised of containers and data. All data is on volumes that can be easily backed up and transferred, and restored. Containers are ephemeral, and can be installed as many times as needed using the installer, or (when enabled) using Docker commands over the internet. Backups can be loaded from the /tmp directory which is also where they are created by default, though you can also use a different backup path.
Backups are only assured to work with the version of GroundWork 8 they were created with. Do not restore backups made with prior versions of GroundWork Monitor. This procedure will fail if you do. If you want to restore an older version, install that version and run the backup commands from that version of the documentation. You can always upgrade.
System Backup
To back up the GroundWork data volumes to your /tmp directory, first ensure there is plenty of space for the backup in /tmp.
Change to the gw8 directory:
cd gw8
CODETake GroundWork down:
docker-compose down
CODESet up and run the backup in the gw8 container with the following command:
TAG=$(grep '^TAG=' .env | sed 's/^TAG=//') docker run --rm \ -v /var/run/docker.sock:/var/run/docker.sock \ -v ${HOME}/.docker:/root/.docker \ -v /tmp:/tmp/tmp \ --name gw8 groundworkdevelopment/gw8:${TAG} \ /src/docker_cmd.sh backupVolumes
CODEBring GroundWork up:
docker-compose up -d
CODE
Alternate Directory for Backup and Restore
Sometimes the /tmp
directory is too small to hold a backup of a fully-configured GroundWork Monitor installation. In this case, you can specify a different path to the backup. Here's how:
Change to the gw8 directory:
cd gw8
CODETake GroundWork down:
docker-compose down
CODESet up and run the backup in the gw8 container with the following command:
TAG=$(grep '^TAG=' .env | sed 's/^TAG=//') docker run --rm \ -v /var/run/docker.sock:/var/run/docker.sock \ -v ${HOME}/.docker:/root/.docker \ -v /alt_dir:/tmp/tmp --env BUPATH=/alt_dir \ --name gw8 groundworkdevelopment/gw8:${TAG} \ /src/docker_cmd.sh backupVolumes
CODEThe
alt_dir
is where you want the backup to be saved. For example, if you have a volume called "backups" where you want to send the backup file, the change:-v /alt_dir:/tmp/tmp --env BUPATH=/alt_dir \
to
-v /backups:/tmp/tmp --env BUPATH=/backups \
will place the backup in this new location. See below for specific restore instructions for using this alternate location.
Bring GroundWork up:
docker-compose up -d
CODE
System Restore
First make sure you have a running install of a version of GroundWork Monitor that is compatible with your backup.
To restore, place the backup .tar.gz file you want to restore in the /tmp directory on the host (this is where the container loads it from):
Change to the gw8 directory:
cd gw8
CODETake GroundWork down:
docker-compose down
CODE
Set up and run the restore from the gw8 container with the following command:
TAG=$(grep '^TAG=' .env | sed 's/^TAG=//') docker run --rm \ -v /var/run/docker.sock:/var/run/docker.sock \ -v ${HOME}/.docker:/root/.docker \ -v /tmp:/tmp/tmp \ --name gw8 groundworkdevelopment/gw8:${TAG} \ /src/docker_cmd.sh restoreVolumes dockergw8_backup_{timestamp}.tar.gz
CODEPrior versions required the /tmp in the path to the backup in this step (e.g. /tmp/dockergw8_backup_{timestamp}.tar.gz). Note that it is now no longer supported to have the /tmp in front of the backup to restore.
Bring GroundWork up:
docker-compose up -d
CODE
System Restore from an Alternate Location
If you made (or moved) your backup to an alternate location, you can restore it from there as well. Here's how:
Change to the gw8 directory:
cd gw8
CODETake GroundWork down:
docker-compose down
CODESet up and run the restore from the gw8 container with the following command:
TAG=$(grep '^TAG=' .env | sed 's/^TAG=//') docker run --rm \ -v /var/run/docker.sock:/var/run/docker.sock \ -v ${HOME}/.docker:/root/.docker \ -v /alt_dir:/tmp/tmp --env BUPATH=/alt_dir \ --name gw8 groundworkdevelopment/gw8:${TAG} \ /src/docker_cmd.sh restoreVolumes dockergw8_backup_{timestamp}.tar.gz
CODEThe
alt_dir
is where the backup you want to restore is located. For example, if you have a volume called "backups" where the backup file is, the change:-v /alt_dir:/tmp/tmp --env BUPATH=/alt_dir \
to
-v /backups:/tmp/tmp --env BUPATH=/backups \
will restore the backup from this location.
Bring GroundWork up:
docker-compose up -d
CODE
Related Resources
-
Page: