jenkins home directory

1,329 views
Skip to first unread message

Hector Magnanao

unread,
Feb 19, 2016, 10:51:59 AM2/19/16
to Jenkins Users
How do I change the home directory for Jenkins without having to reinstall ? And how do I verify the new home directory once it's changed ?

geoffroy...@gmail.com

unread,
Feb 19, 2016, 12:12:58 PM2/19/16
to Jenkins Users
Hello
basically i think you have to:
  1. shutdown your jenkins instance
  2. move the folder /path/to/old_jenkins_home to the new location /path/to/new_jenkins_home
  3. create an environment variable JENKINS_HOME, which value is /path/to/new_jenkins_home
  4. start your jenkins instance
You should then get the same jenkins as before

Depending on how you use Jenkins (windows service, linux package, tomcat app), then what can differ is the way of setting/providing the JENKINS_HOME environment variable


https://stackoverflow.com/questions/14139168/how-can-i-point-jenkins-to-another-jenkins-home-directory

Gurusharan S

unread,
Feb 21, 2016, 11:01:35 AM2/21/16
to Jenkins Users
Hi Hector,

On how to verify the new home directory, you need to go to the Configure jenkins page: Manage Jenkins -> Configure System.

Typically the jenkins home directory of the current instance will be displayed first in the form.

Hope this helps,

Bye for now,
Gurusharan S.

Hector Magnanao

unread,
Feb 26, 2016, 4:45:47 PM2/26/16
to Jenkins Users
I followed the steps above but when I verified, the old home directory is still showing up.  How do I change the home directory for my login in Jenkins to the new Jenkins home ?

Gurusharan

unread,
Feb 26, 2016, 10:36:51 PM2/26/16
to jenkins...@googlegroups.com

Hi Hector,

Did you try the steps Geoffroy had explained?

If so can you please brief us on how you are running Jenkins (windows service, init.d on linux, etc.) and how you followed those steps.

The steps are generic, how ever depending on how you run Jenkins, setting up the environment might be tricky and so, the more information you can provide the better it is to help troubleshoot.

Regards,
Gurusharan S.

--
You received this message because you are subscribed to a topic in the Google Groups "Jenkins Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jenkinsci-users/eXEvmIA9sYk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/e15caf38-d4bb-4a93-848b-8d8a0f0b3a59%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Hector Magnanao

unread,
Feb 29, 2016, 10:39:54 AM2/29/16
to Jenkins Users
Hi Gurusharan,

Yes, I followed the exact steps that Geoffroy outlined above:
  1. shutdown your jenkins instance
  2. move the folder /path/to/old_jenkins_home to the new location /path/to/new_jenkins_home
  3. create an environment variable JENKINS_HOME, which value is /path/to/new_jenkins_home
  4. start your jenkins instance
I am currently running Jenkins as a windows service.  I noticed that if I run the jenkins service from the command line and go into Jenkins, the new home directory is reflected.  But when run it as a windows service, the old home directory is still showing.  How would I do that so my new home directory is reflected from the windows service ?

Hector


On Friday, February 26, 2016 at 9:36:51 PM UTC-6, Gurusharan S wrote:

Gurusharan

unread,
Mar 1, 2016, 8:51:50 PM3/1/16
to jenkins...@googlegroups.com
Hello Hector,

I see now what's the problem. I believe the environment variables may not be taken by the service, it uses jenkins.xml to get the environment variables. By default, a windows service uses the jenkins directory you give for installation as the jenkins home.

Can you please check if the steps in this link help you?

Please note that you MUST not move some of the files from the old jenkins directory and that you need that directory to stay there (I mean you should not be deleting the whole directory).

Bye for now,
Gurusharan S.

Hector Magnanao

unread,
Apr 6, 2016, 1:05:53 PM4/6/16
to Jenkins Users
Hello Gurushan,

These steps worked great !!! One thing that I noticed that restarting Jenkins didn't update the JENKINS_HOME variable for me.  I had to actually reboot the machine.  After that, I went into Manage Jenkins console and I saw the variable change.

Thanks,
Hector

Gurusharan

unread,
Apr 13, 2016, 10:41:38 AM4/13/16
to jenkins...@googlegroups.com
Thanks for the info Hector.

Glad that it worked.


Bye for now,
Gurusharan S.

Reply all
Reply to author
Forward
0 new messages