Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Update Jenkins which is currently running as a Linux service

Tags:

jenkins

How do I update jenkins from a existing jenkins install running as a Linux service without loosing any jobs or config?

like image 475
IanWatson Avatar asked Feb 24 '15 09:02

IanWatson


People also ask

How do I update Jenkins from command line?

There is no way to update the Jenkins version via the Jenkins CLI. If you installed Jenkins as a standalone WAR file, all you need to do to upgrade it from the command line is to download the new Jenkins WAR file and replace your current WAR file, then restart Jenkins.


1 Answers

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).

like image 138
Bruno Lavit Avatar answered Sep 30 '22 19:09

Bruno Lavit