Restoring from a BBR Backup
ivotal recommends that you create and restore Concourse backups with BOSH Backup and Restore (BBR). The process for restoring involves the following prerequisites:
- A valid BBR backup of Concourse. If you have not used BBR before, see the Performing a backup with BBR guide to get started.
bbr, the BOSH Backup and Restore (BBR) CLI tool
fly, Concourse's CLI tool
With those conditions met, you can use this guide to perform a restore operation.
Reasons to restore Concourse from a backup include:
- Something went wrong with your Concourse pipelines
- You want to validate that a backup works
- An upgrade/downgrade failed
Creating and then validating backups can even be automated into a Concourse pipeline.
Note about restoring Concourse
Currently only restoring Concourse to a fresh deployment is supported.
If there is existing data, errors can arise when restoring Concourse.
This guide assumes you have done a bbr backup on some Concourse instance and you want to restore the backup to a new deployment.
Go to install docs to create a new deployment and use the
backup-atc.ymlops-file. This ops-file will ensure the
database-backup-restorerjobs are on the same VM instance as PostgreSQL.
At this point, you should have a BOSH deployment of Concourse and PostgreSQL that you can target.
If your PostgreSQL instance where the Concourse
atc database is located is managed separatly from your Concourse BOSH deployment you will have to ensure that the
database-backup-restorer jobs are on the same VM instance as PostgreSQL.
Configure the database with
superuser capabilities for Concourse to enable
There are two methods that can be used to address this step. Please read both methods below and choose the one that seems most appropriate.
Log into Concourse's postgres instance using
psqlor your preferred database client
# ssh onto the vm where postgres is running bosh -d DEPLOYMENT ssh INSTANCE_NAME
DEPLOYMENTis the BOSH deployment where PostgreSQL is running
INSTANCE_NAMEis the VM instance where PostgreSQL is running
To figure out what
INSTANCE_NAMEshould be you can run
bosh vmsto see what instance names are part of your BOSH deployment. For example:
bosh -d DEPLOYMENT vms
Once you're ssh'd on the VM and you have access to a user (DB_USER) with the superuser permission, you can login using
1 2 3 4 5 6
$ /var/vcap/packages/postgres-11.5/bin/psql -d atc -U DB_USER -W Password: <input password> psql (11.5) Type "help" for help. atc=>
ALTER USER <concourse_db_user> WITH SUPERUSER;
Modify the PostgreSQL manifest to elevate the Concourse role to
SUPERUSER. Fill out the
databases.roles[n].permissions field in the
1 2 3 4 5 6 7 8 9 10 11 12
Deploy Concourse database instance
After updating the BOSH manifest to give the database user superuser permissions, the database will have to be redeployed.
- If part of Concourse deployment, use BOSH to redeploy the db vm.
- If separate from the Concourse deployment, follow infrastructure specific instructions.
bbr deployment restorecommand:
1 2 3 4
bbr deployment \ --deployment TARGET-CONCOURSE \ restore \ --artifact-path PATH-TO-BACKUP
TARGET-CONCOURSEis your target deployment, and
PATH-TO-BACKUPis the path to the backup directory you wish to restore from.
Make sure that you are running the same version of Concourse that your backup was created from.
Verify your pipelines have been successfully restored
Run the following command to verify that the state of your pipelines has been restored:
fly -t TARGET-CONCOURSE pipelines
TARGET-CONCOURSEis your target deployment.
Broken git Resources
Symptom: After a restore, git repository resources appear broken with an error like this:
Solution: Recreate the pipelines by running
Cannot Drop Table
Symptom: There's an error when restoring Concourse like this:
1 2 3 4 5 6 7 8 9 10 11 12
Solution: Restore Concourse to a fresh deployment. This happens when restoring Concourse to a deployment with existing data.
Unregistered Redirect URI
Symptom: When logging in after BBR restoration, there's an error like this:
Solution: Stop and restart the Concourse web instance(s).