Credentials config sync between Jenkins controller

Hi Team,

We installed jenkins in new RHEL 8.x server. It will be the failover server of the existing prod server.

In order to replicate the configuration, i have done rsync the Jenkins directory “/var/lib/jenkins” from Prod → New failover server. All plugins, jobs are replicated in new server which is good. Below is the rsync command used on Prod that copies the directory on new server.

$ rsync -aP --delete --exclude nodes --exclude jenkins.model* /var/lib

Credentials stored for each project folder is listing in new server, but the its not working. (example) We use SSH private keys as credentials for projects, They are listing in the credentials store, but its not working. We had to re-load the password for each credentials to make it work.

Can you please suggest how to replicate the credentials store successfully from Prod to new server so we dont need to update the password/key for each credentials in new server ?

Thanks

Has you copy the secret and notsosecret files. They are located in root jenkins directory.

Ps maybe are the names not correct, but when you look there you will see what i mean.

Yes, Following files are copied, but the credentials not working.

$ ls -l secret
-rw-r–r–. 1 e2eauto e2eauto 64 Apr 27 2020 secret.key
-rw-r–r–. 1 e2eauto e2eauto 0 Apr 27 2020 secret.key.not-so-secret

Wr migrate our old centos server to official jenkins Debian docker image. We has the same issue and i think we solved it like here described

1 Like