Restore credentials

1 minute read

There are two primary use cases where you may need to move credentials between controllers:

  • Cloning a controller.

  • Moving jobs from a monolithic controller into a smaller team controller.

Managing credentials when cloning a controller

You may need to create a test controller from the backup of a production controller. If you do so, and the controllers are in the same cluster, you may receive errors, and should use the following instructions to resolve the problem:

  1. Sign in to the origin controller and stop the controller.

  2. Using administrative SSH or console access, sign in to the controller and remove the following files:

    • $JENKINS_HOME/license.xml

    • $JENKINS_HOME/operations-center-cloud*

    • $JENKINS_HOME/operations-center-client*

    • $JENKINS_HOME/com.cloudbees.opscenter.client.plugin.OperationsCenterRootAction.xml

  3. Disable security:

    1. Open $JENKINS_HOME/config.xml.

    2. Locate the line <useSecurity>true</useSecurity> and change the value to <useSecurity>false</useSecurity>.

    3. Save $JENKINS_HOME/config.xml.

  4. Start the Jenkins service.

  5. Create a new client controller in the operations center and push the modified configuration in $JENKINS_HOME/config.xml to it.

Managing credentials when moving jobs between controllers

If you are moving a set of jobs from a monolithic controller to a team controller and you receive "duplicate instance" errors:

  1. Stop Jenkins.

  2. Change to the $JENKINS_HOME directory.

  3. Delete the secret.key file.

  4. Delete the license.xml file.

  5. Start Jenkins.

Navigate to Manage Jenkins  Manage License to display your instance ID. You can also go to https://$JENKINS_URL/license to view the instance ID associated with your license.