-
Notifications
You must be signed in to change notification settings - Fork 0
Backup Recovery
It is not possible to restore backups automatically on staging because the VM doesn't have permission to access the backup servers.
What you need to do instead is to manually create a database dump, push it to the staging VM, and from there run a command to restore it into the running docker container. This is similar to how the manual backup restoration is done locally, as described in the infrastructure README, but with the extra step of pushing the backup to the staging VM.
First, create a database dump from production:
cd /docker/rdflog && docker-compose exec -T db pg_dump -Cc --if-exists -d rdflog | gzip -c > /tmp/rdflog_dump.gz
Then push it into the staging VM:
lxc file push /tmp/rdflog_dump.gz staging/tmp/rdflog_dump.gz
Now you can delete the temporary file with the dump:
rm /tmp/rdflog_dump.gz
Restore the dump into a fresh running docker container called rdflog:
zcat /tmp/rdflog_dump.gz | docker exec -i -u postgres rdflog psql -q