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 only be loaded from the /tmp directory which is also where they are created by default, though you can also use a different mount point.

Backups are only assured to work with the version of GroundWork 8 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 GroundWork 8 afterward.

System Backup

  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
    CODE
  3. Take GroundWork down:

    docker-compose down
    CODE
  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
    CODE


    • The resulting file name is of the form of /tmp/dockergw8_backup_{timestamp}.tar.gz, e.g., /tmp/dockergw8_backup_20191128231820.tar.gz

      If your /tmp directory is too small to contain what could potentially be hundreds of gigabytes, you can map to a larger partition by changing the -v option. For example, if you have a volume called "backups" where you want to send the backup file, change:

      -v /tmp:/tmp/tmp \

      to

      -v /backups:/tmp/tmp \

      Similarly, you would change the restore command below to point to the same location. 

  5. Bring GroundWork up:

    docker-compose up -d
    CODE

System 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
      CODE
    • Take GroundWork down:

      docker-compose down
      CODE
  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
    CODE
  4. Bring GroundWork up:

    docker-compose up -d
    CODE

Related Resources