How to migrate credentials to a new Jenkins instance?


  • I have a new instance of Jenkins and want to migrate credentials from an old instance.



Case A - Root Level

1. Stop new and old Jenkins instances.

2. Delete file identity.key.enc from $NEW_JENKINS_HOME/identity.key.enc.

rm JENKINS_HOME/identity.key.enc 

3. Copy secret files and folder from $OLD_JENKINS_HOME/secret* to the new $NEW_JENKINS_HOME root


4. Copy credentials.xml file from $OLD_JENKINS_HOME/credentials.xml to the $NEW_JENKINS_HOME root


5. Finally, restart the new instance. Note that identity.key.enc should be regenerated on the new instance.

Case B - User and Folder Level

Credentials at User and Folder level are embedded in their respective config.xml so the recommended way to do it is by Migrating Entire Jenkins Configuration, Including Jobs.

Have more questions? Submit a request


  • 0
    Aurelio Soria

    This worked for me without deleting secret and the identity files. But, my old jenkins is v. 1.599 to latest CJE. I just stop jenkins secure copy over credentials.xml and start jenkins. All good.

  • 0
    Phanikumar Dadi

    I would like to migrate my old Jenkins server 1.565.3 to a new Jenkins latest version on another instance. So,  I have copied all the files listed above. But I am still getting an issue with Git credentials. Can someone help me out on this.

  • 0
    James Brown

    Hi Phanikumar,

    I wasn't able to identify if you're an existing customer. If you are we'd be happy to assist over a case. Otherwise, you might ask in our subscriber Community.

    If you'd like me to connect you with an Account Executive to discuss a subscription you can email me directly

Please sign in to leave a comment.