Copying Jenkins home gives duplicate instance ids


  • I want to create a clone from an existing $JENKINS_HOME for another Jenkins instance id
  • I create/regenerate a new instance id
  • I am migrating my instance to a new environment



If you need to duplicate a Jenkins instance by copying the entire $JENKINS_HOME it will lead to duplicate instance ids. You can re-create the instance id for the new Jenkins installation by doing the following:

  1. Stop the Jenkins instance.
  2. cd to $JENKINS_HOME
  3. Delete the current secret.key file: rm secret.key
  4. Delete the license.xml file: rm license.xml
  5. Start Jenkins again.

To get the license ID follows this article What is a CloudBees Instance ID and how do I find it?.

Have more questions?


  • 1
    Alexander Ost

    It seems that some additional steps are required when copying a JENKINS_HOME of a CJEE master that's connected to CJOC. I had to force-push a new clienst master connection from cjoc side to get the copy running properly.

    Edited by Alexander Ost
  • 0
    Brian Vandegriend

    I tried these steps with Jenkins 2.7.19 and it doesn't work (I'm not using Operation center). 

    I deleted the secrets.key file along with license.xml. When I restarted the Jenkins service on the test server, I got this fatal error: "An error occurred: Default update site connectivity check failed with fatal error: Cannot check connection status of the update site with ID='cje-offline'." 


  • 0
    Lokesh Kamalay

    maybe this information related to CJP is outdated now as CJE and Jenkins X are dominating,

    I had to follow these steps to make it work.

    1. Login to Jenkins Master and Remove all these files

    • $JENKINS_HOME/license.xml
    • $JENKINS_HOME/operations-center-cloud*
    • $JENKINS_HOME/operations-center-client*
    • $JENKINS_HOME/com.cloudbees.opscenter.client.plugin.OperationsCenterRootAction.xml

    2. Disable the Security,

    Open $JENKINS_HOME/config.xml. Locate this line: <useSecurity>true</useSecurity> and changing it to <useSecurity>false</useSecurity>

    3. Start the Jenkins Service

    4. Create a new client master in CJOC and push the configuration which will now allow you to connect successfully.

Please sign in to leave a comment.