Back up and Restore

GroundWork Monitor 8.0.0 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 only be loaded from the /tmp directory which is also where they are created.

Backups are only assured to work with the version of GW8 they were created with. If backups made from previous versions are restored, migrations will have to be run again by reinstalling more recent versions of GW8 afterward.

Back Up

  1. To back up the GroundWork data volumes to your /tmp directory, first ensure there is plenty of space for the backup in /tmp.
  2. Change to the gw8 directory:

    cd gw8
  3. Take GroundWork down:

    docker-compose down
  4. Set 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

    The resulting file name is of the form:

    /tmp/dockergw8_backup_{timestamp}.tar.gz

    for example:

    /tmp/dockergw8_backup_20191128231820.tar.gz
  5. Bring GroundWork up:

    docker-compose up -d

Restore

  1. First make sure you have a running install of a version of GroundWork Monitor that is compatible with your backup. 
  2. 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
    • Take GroundWork down:

      docker-compose down
  3. 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  /tmp/dockergw8_backup_{timestamp}.tar.gz
  4. Bring GroundWork up:

    docker-copose up -d

Related articles