Backup and restore



Dump database

docker exec -ti postgres pg_dump -Fc -U postgres elm-integration -f /tmp/gamebench-postgres-backup-$(date +"%Y-%m-%d_%H-%M-%S").dump

Restore database from backup

Please note the database will be dropped before being restored, ensure the backup is taken first and the file was successfully written.

docker exec -ti postgres psql -U postgres -c 'DROP DATABASE "elm-integration"'
docker exec -t postgres pg_restore -C -d postgres -U postgres /tmp/<backup postgres filename>


If you’ve bind-mounted your data directory, you can skip this step and use the bind mount destination.

Find volume mountpoint

docker volume inspect -f '{{.Mountpoint}}' $(docker volume ls | grep filedata | awk '{ print $2 }')

Archive data

sudo tar -C <volume mountpoint> -czf gamebench-data-backup-$(date +"%Y-%m-%d_%H-%M-%S").tar.gz .

Restore data

sudo tar -C <volume mountpoint> -xzf <data backup filename>


The following documentation only applies to installations running both Postgres and Elasticsearch on a single server. If you have an alternative installation please contact us at for assistance with your backups.

Please ensure you take backups at regular intervals.


To backup Postgres and Elasticsearch to a single archive, run the following:

./ backup

This will generate a file such as: /tmp/gb-private-server-backup-2019-08-05_14-59-56.tar.gz. We recommend storing your backups in a different physical location to the server or on a cloud storage service such as AWS S3.


To restore a backup, run the following command. You’ll be prompted for confirmation. Please be careful with this, all of your data will be overwritten from the backup.

./ restore <backup file>
Last updated on