How to migrate Jenkins credentials from old server to the new one.

1. Create same git users with whatever password you want (later will be overwrite)on the new JENKINS server.

2. Stop new and old Jenkins servers.

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

cp -R $OLD_JENKINS_HOME/secret* $NEW_JENKINS_HOME

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

cp $OLD_JENKINS_HOME/credentials.xml $NEW_JENKINS_HOME

5. Start the new JENKINS server.

NOTE:  This approach was susccessfully tested on both linux and windows.

Click to rate this post!
[Total: 4 Average: 3.3]