Disaster recovery
It is important to prepare your system and regularly capture full snapshots. This backs up your data and makes it easier to restore your system if disaster recovery is needed.
Ensure you are running a version of the module that matches the version of the backup being used for the migration and that the target has been updated in Hiera to reference the new target system. Update the leaf certificate in
ssl_cert_chain in Hiera to point to the new resolvable_hostname.Prepare your system to support future disaster recovery
To make sure your system is equipped to help you recover from a potential system failure, you must:
-
Track the Continuous Delivery Bolt project in version control and push the project to this repo whenever changes are made and applied to the Continuous Delivery target host.
-
Create a backup of the Continuous Delivery application using
bolt plan run cd4peadm::backupon a regular basis and copy the resulting backup artifact to a secure location, such as an NFS share, S3 bucket, distributed file system, cloud storage, etc.
./keys directory should be stored separately. Do not include them in version control.Disaster recovery process
Depending on the nature of the disaster you may need to follow different processes. This section covers a few disaster recovery scenarios.
Loss of the Continuous Delivery Bolt project
-
Restore the Bolt project from version control.
-
Restore the private key from its separate secure storage.
Loss of the Continuous Delivery host
If you lose the Continuous Delivery host, you can restore the application from a backup file.
Update the
resolvable_hostnamein data/common.yaml to the new hostname.Update inventory.yaml to the new target host information.
Update the leaf certificate in
ssl_cert_chainin Hiera to point to the newresolvable_hostname.
-
Create a new Continuous Delivery installation. From the Continuous Delivery Bolt project directory, run:
Copybolt plan run cd4peadm::install -
Copy the tarball of the most recent backup into /var/lib/puppetlabs/cd4pe/backups on the new target host.
-
Restore the backup using:
Copybolt plan run cd4peadm::restore backup=<backup name>.zipInclude the
.zipfile extension in the backup name. -
After the restore, update any webhooks that reference the previous hostname. For more information, see Troubleshooting Continuous Delivery (CD).
-
Align the database passwords using:
Copybolt plan run cd4peadm::apply_configurationThis ensures that the database passwords are updated to match the configuration values in the data/common.yaml file.
Loss of both the Continuous Delivery Bolt project and the Continuous Delivery host
Follow the process described in both scenarios, first the Continuous Delivery Bolt recovery then the Continuous Delivery recovery.