Migrating Jenkins Credentials
Jul 5, 2019
If you need to migrate a Jenkins Instance to newer instance, there may be need to import credentials. If that is the case then the following may help:
- First stop both Jenkins instances.
- Within the New Jenkins Instance remove the
identity.key.encfile which can be found in$JENKINSHOME
rm identity.key.enc - Zip up the
credentials.xmlfile and anything beginning withsecretin the$JENKINSHOMEdirectory. Afterwards we will send it to the new Jenkins instance.
tar -czvf credentials.tgz secret* credentials.xml
scp credentials.tgz user@new-jenkins-server:/tmp/ - Next extract the
credentials.tgzfile in the$JENKINSHOMEdirectory and start up your new Jenkins instance.
tar -xzvf /tmp/credentials.tgz $JENKINSHOME After you start up your new Jenkins instance you should be set. Note that in the event you do not see the exported credentials, you should restart you new Jenkins instance.
Special thanks to https://itsecureadmin.com/2018/03/jenkins-migrating-credentials/