Backup & Restore scripts for Control Tower Concii
These scripts are designed primarily for DR where a Concourse is being backed up then restored to a different, empty Concourse.
It is not designed for use cases such as selectively restoring teams, secrets, or pipelines. You may encounter data loss or unexpected results if you try restoring to a non-empty Concourse.
-
Set the following env vars for the Concourse you want to backup
ADMIN_PASSWORD: CONCOURSE_URL: CREDHUB_CA_CERT: CREDHUB_CLIENT: CREDHUB_SECRET: CREDHUB_SERVER:
-
Fly execute the task
$ fly -t some-target execute -c examples/backup.yml -o out=./out ... exporting teams setting admin on all teams exporting pipelines setting correct auth on all teams Key: <KEY> out: 1.66 MiB/s 0s succeeded
-
Take note of the key from the output and store the files in
out
securely somewhere
-
Set the following env vars for the Concourse you want to restore to
ADMIN_PASSWORD: CONCOURSE_URL: CREDHUB_CA_CERT: CREDHUB_CLIENT: CREDHUB_SECRET: CREDHUB_SERVER: ENCRYPTION_KEY:
NOTE:
ENCRYPTION_KEY
comes from the output at the end of the backup task (see above) -
Fly execute the task
$ fly -t some-target execute -c examples/restore.yml -i backup_source=<path/to/backup/output/dir> --include-ignored ... setting admin on all teams importing pipelines setting correct auth on all teams beginning credhub import - this may take a while ... succeeded
NOTE:
--include-ignored
is needed if your backup dir isout
in this repo since it is in.gitignore
Against origin Concourse:
fly -t origin login
# For each team
fly -t origin pipelines --json > pipelines.json
Against target Concourse:
fly -t target login
# For each team
examples/unpause_expose.rb ebci pipelines.json
bundle exec rspec