Restore CloudBees CD/RO on Kubernetes

2 minute readReference

This page outlines the processes and steps needed to recover your CloudBees CD/RO server and help ensure critical data is not lost due to unforeseen circumstances.

Depending on your specific environment, not all information here may be relevant. Additionally, if your environment is highly-customized, the steps here may not be the most optimal, and additional solutions may be required.

Lastly, there are multiple third-party solutions for creating and restoring backups, including locally and cloud-hosted tools. CloudBees offers no support for these tools, except for the specific use cases explained in the product documentation.

Restore configuration data

As part of restoring your cluster you must have the:

  • Keystore file

  • Passkeys file

Additionally, these files must be converted to base64 format, which can then be included in your helm install/upgrade command.

To convert your keystore and passkey files to base64:

  1. For your keystore backup file, run the following command:

    base64 -i keystore -o keystore.b64
  2. For your passkey backup file, run the following command:

    base64 -i passkey -o passkey.b64

Your files can now be included with your helm install/upgrade command. To continue with restoring your data, refer to Restore CloudBees CD/RO server data.

Restore CloudBees CD/RO server data

There are two main ways that can be used to restore CloudBees CD/RO data:

  • Restoring your database.

  • Restore CloudBees CD/RO instance from XML.

Restore CloudBees CD/RO database on Kubernetes

To restore your backup database in CloudBees CD/RO:

You must have a copy of your license.xml to complete the following steps.
  1. Start the database service in your Kubernetes cluster using your backup version.

  2. In your values file, ensure the following entries are present and updated for your database:

    • database.externalEndpoint

    • database.dbPort

    • database.dbType

    • database.dbName

    • database.dbUser

    • database.dbPassword

  3. Set the following variables:

    If performing a complete recovery, the keystore and passkey files must be in base64 format to include them in your helm install/upgrade command. If you have not already done so, refer to Restore configuration data before proceeding.

    releaseName="<your-current-release>" namespace="<your-current-release-namespace>" valuesFile="<path-to-your-values-file.yaml>" passkeyFile="<path-to-your-passkey.b64>" keystoreFile="<path-to-your-keystore.b64>" licenseFile="<path-to-your-license.xml>"
  4. Install CloudBees CD/RO using your helm install command.

    Example helm install command:

    helm install $releaseName cloudbees/cloudbees-flow --namespace $namespace \ --values $valuesFile \ --set-file server.customConfig.passkey\\.b64=$passkeyFile \ --set-file server.customConfig.keystore\\.b64=$keystoreFile \ # Helm upgrades exit when all tasks are complete, regardless of timeout. # However, if your database is very large, the timeout may need to be increased to prevent returning a FAILED status. # For instance: --timeout 10800s --timeout 4200s \ --set-file flowLicense.licenseData=$licenseFile
If you are installing a CloudBees CD/RO instance with an external database, do not use the --wait option. The flow-server-init-job cannot be started if --wait is used.

Restore CloudBees CD/RO instance using XML backup

If you have an XML backup of your CloudBees CD/RO data, this file can be imported using ectool import. For more information, refer to ectool import.

Your CloudBees CD/RO instance must already be running and connected to your database for this process to work correctly.