How do I update jenkins from a existing jenkins install running as a Linux service without loosing any jobs or config?
Asked
Active
Viewed 1.1k times
9
-
1https://wiki.jenkins-ci.org/display/JENKINS/Automated+Upgrade – André Stannek Feb 24 '15 at 10:00
-
`without loosing any jobs or config` You can [shutdown](http://stackoverflow.com/questions/10238604/how-to-shutdown-my-jenkins-safely) Jenkins before update. – Gluttton Feb 24 '15 at 10:06
1 Answers
20
First, you need to find where your jenkins.war file is installed:
locate jenkins.war
On my Centos machine, it's here: /usr/share/jenkins/jenkins.war
Stop the Jenkins service:
service jenkins stop
Next, you can backup the existing jenkins.war file:
cd /usr/share/jenkins
mv jenkins.war jenkins-1.586.war
And to finish, please copy the new jenkins.war file in the same location:
cp jenkins.war /usr/share/jenkins/jenkins.war
Restart the Jenkins service:
service jenkins start
It should work and you should retrieve your Jenkins configuration (which is stored in your Jenkins home folder).

Bruno Lavit
- 10,184
- 2
- 32
- 38
-
Followed instructions but when issueing service jenkins status I get jenkins dead but pid file exists – IanWatson Feb 25 '15 at 12:26
-
java.io.FileNotFoundException: /var/cache/jenkins/war/META-INF/MANIFEST.MF (Permission denied) Chowning directory to the user jenkins run's as fixed the problem – IanWatson Feb 25 '15 at 12:45
-
When you copied the war file, which Linux account did you use? Jenkins, root or another account? After fixing the permission on your folder, can you confirm that the Jenkins upgrade is OK and that you didn't loose your Jenkins config? – Bruno Lavit Feb 25 '15 at 13:23
-
-
-
I followed these directions but couldn't get Jenkins to start, until I realized it had been installed as an rpm, and all I needed was "sudo yum update jenkins" – Ben Fulton May 26 '17 at 12:46