Database Back up Restore
Click the link above if you are not automatically redirected in 10 seconds.
This article covers how to back up and restore individual GroundWork 8 databases.
The GroundWork 8 databases contain your data, and you may want to extract that data for your own purposes, or to move it to another server for testing or development reasons. We sometimes use copies of databases to share example configurations, test solutions for support cases, and other ad-hoc work with data and analysis. These procedures are provided so that you can do so as needed.
gwadmin account
gwadmin
account to perform the backup and restore processes. This is a privileged account in GroundWork 8 and the authentication information is hidden in a secure file in the container file system. The default credential is just gwadmin
. If you do decide you need to change this password, please Submit a Ticket at GroundWork Support for assistance./tmp directory
root
. The backup file can be renamed to suit. Backup files should be stored (manually moved) outside the volatile /tmp
directory. To be restored, the backup files will need to be copied back into the /tmp
directory.Back Up
Change to the
gw8
directory:cd gw8
The monitoring system doesn't need to be down to create an individual database backup, but you might want to have it be down to ensure a completely consistent state on restore. To optionally take GroundWork down:
docker-compose down
To backup a single database from a running GroundWork system, run the following commands, specifying the database to back up:
Supported databases include:- archive_gwcollagedb
- dalekstore
- elastic
- gwcollagedb
- influxdb
- jasperserver
- monarch
- nedi
- nedi_nodes
- noma
- report_db
- slareport
For backup files
For the specification of theSERVER_NAME
, this is optional (it is only required to name the backup files).TAG=$(grep '^TAG=' .env | sed 's/^TAG=//') SERVER_NAME=$(hostname -f) docker run -it --rm \ --network=default \ -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 backupDatabase <database> [-s $SERVER_NAME]
Enter the gwadmin password when prompted. The resulting file name is of the form e.g., monarch:
/tmp/dockergw8-backup-monarch-20200420205424.sql.gz
To backup a single database from a stopped GroundWork system, run the following commands, specifying the database to back up:
TAG=$(grep '^TAG=' .env | sed 's/^TAG=//') SERVER_NAME=$(hostname -f) docker run -it --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 backupDatabase <database> [-s $SERVER_NAME]
Enter the gwadmin password when prompted.
If you brought it down, bring GroundWork up:
docker-compose up -d
Restore
- First make sure you have a running install of a version of GroundWork Monitor that is compatible with your backup. If backups made from previous versions are restored, migrations will have to be run again by reinstalling the more recent version.
- To restore, place the backup file you want to restore in the
/tmp
directory on the host (this is where the container loads it from), symlinks are not supported:Change to the
gw8
directory:cd gw8
To restore, GroundWork must be stopped. Take GroundWork down:
docker-compose down
Set up and run the restore from the
gw8
container with the following command:TAG=$(grep '^TAG=' .env | sed 's/^TAG=//') docker run -it --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 restoreDatabase <database> <database backup file path>
Enter the gwadmin password when prompted.
Bring GroundWork up:
docker-compose up -d
Related articles
-
System Back up Restore (Documentation)