9 Restoring: a lost host, or a move to a new one
This also covers a machine you have rebuilt.
-
On the new host, install Docker and the host tools the Administrator's Guide lists. Unpack the same release, or a later one, into a new directory. Put the original
.envand your Compose additions there. ChangeAPP_URLandDOMAINonly if the address is changing. Do not start the stack. -
Copy the two backup files from one run to the host.
-
Restore. The script refuses a database that already holds data:
./deploy/restore.sh /var/backups/grc/db-<stamp>.dump /var/backups/grc/uploads-<stamp>.tar.gzFor
.agefiles, also setBACKUP_AGE_IDENTITY=/path/to/key. Compose may warn that the uploads volume was not created by Compose: the script made it, and that's harmless.If loading the database fails, it is left empty, so fix the cause and run the same command again. If a later step fails, the database is restored and the same command refuses to run. The script says so: fix the cause, run
./deploy/restore.sh --files-onlywith the archive, and carry on. Don't remove the database volume to get past it. -
Build the image and run
migrate, withweband the worker off.migratebrings the schema up to this release, and creates the application role:docker compose build docker compose run --rm migrate -
Follow "After any restore", below.