A backup of BareBones Validation has five parts. Take them together, as one set, and restore them together.
| Part | What it holds |
|---|---|
| The database | Every record. |
| The evidence volume | The evidence files and the generated packages. |
| The key volume | The program's data-protection keys. The stored licence key can be read only with them. |
.env |
The installation's settings. |
| The HTTPS certificate | https/bbv.pfx, or the file you use instead. |
Back up
Run these in the installation directory. Stopping the web service gives a consistent backup; nobody can use the program while it is stopped.
umask 077
mkdir -p backup
docker compose stop web
docker compose exec -T db sh -c 'pg_dump -U "$POSTGRES_USER" -d "$POSTGRES_DB" -Fc' > backup/database.dump
docker compose run --rm --no-deps -T --entrypoint tar web -C /var/lib/bbv/artifacts -czf - . > backup/artifacts.tar.gz
docker compose run --rm --no-deps -T --entrypoint tar web -C /root/.aspnet/DataProtection-Keys -czf - . > backup/keyring.tar.gz
cp .env backup/installation.env
cp https/bbv.pfx backup/bbv.pfx
docker compose start web
The folder backup then holds five files: database.dump,
artifacts.tar.gz, keyring.tar.gz, installation.env and bbv.pfx.
If you use your own PostgreSQL server, replace the db command with your
server's backup procedure. If the certificate is stored elsewhere, copy that
file.
The backup holds passwords and keys. Store it as you store other secrets, and keep a copy that is not on this server.
Restore
Restore into an installation that holds no data, with the package version that made the backup. The steps are for the bundled database.
- Put the package in the installation directory, check it and load the image,
as in step 1 of Install on Linux.
Do not run
configure-database.shyet. - Copy the
backupfolder into the installation directory. -
On a server that had BareBones Validation before, remove what is left of it. This deletes the records, evidence and keys on this server:
./uninstall.sh --remove-data --confirm BareBonesValidation -
Put the settings and the certificate back:
umask 077 mkdir -p https cp backup/installation.env .env cp backup/bbv.pfx https/bbv.pfx -
Start the database alone and restore it:
docker compose up -d --wait db docker compose exec -T db sh -c 'pg_restore -U "$POSTGRES_USER" -d "$POSTGRES_DB"' < backup/database.dump -
Restore the evidence and the keys:
docker compose run --rm --no-deps -T --entrypoint tar web -C /var/lib/bbv/artifacts -xzf - < backup/artifacts.tar.gz docker compose run --rm --no-deps -T --entrypoint tar web -C /root/.aspnet/DataProtection-Keys -xzf - < backup/keyring.tar.gz -
Start the program:
./configure-database.sh docker compose ps
With your own PostgreSQL server, restore the database into an empty database with your server's procedure in place of step 5.
Check the restore
/healthzshows the package version, as in step 5 of Install on Linux.- People sign in with the passwords they had when the backup was taken.
- Validation lists the release candidates, and a package opens with its evidence.
- Administration › Licence shows the licence key as entered, and This installation reads as it did when the backup was taken.
If the keys were not restored, the Licence page says the stored key can no longer be read on this installation. Select Remove key and enter the key again.
Move to another server
- On the old server, open Administration › Licence and select Deactivate this installation. This frees the activation for the new server. The old installation is read-only from then on.
- Back up the old server.
- Restore on the new server by the steps above.
- If the address changes, set
BBV_PUBLIC_BASE_URLin.envand use a certificate for the new address before step 7. - On the new server, open Administration › Licence and select Activate this installation.