How to change Jenkins default folder on Windows where Jenkins runs as Windows service.
I want to change C:\Users\Coola\.jenkins
folder to d:\Jenkins
due to lack of space on C:
partition (Every build takes ~10MB of free space). I don't want to reinstall Jenkins
as Windows service. I just want to change folder of existing Jenkins
instance. In case of lack of global solution I could focus only on relocating jobs
folder.
Thanks in advance for your help.
And in addition to grams answer, the most important part is creating an environment variable named JENKINS_HOME with value "D:\Jenkins". Without that, on starting Jenkins it would again create the .jenkins folder in your user home folder.
Apparently, grams' answer works but is not preferred. In Windows software and data/configuration files are supposed to reside in different places. This should be well known to Unix guys, it is basically like having a home directory. However, the wording with regard to JENKINS_HOME is broken anyways as setting an environment variable does not help despite what is being said in the help text.
I used the procedure that is described here: http://tech.nitoyon.com/en/blog/2014/02/25/jenkins-home-win/
Basically:
<env name="JENKINS_HOME" value="%BASE%"/>
injenkins.xml
in the Jenkins installation directory. This will be something likeC:\Program Files (x86)\Jenkins
. In your casevalue
has to be set tod:\Jenkins
Move Files from the installation directory to the new destination,
d:\Jenkins
, all except (some of them may not exist in a fresh installation)jenkins.xml
C:\Users\Coola\.jenkins
folder tod:\Jenkins
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Jenkins\ImagePath
to"d:\Jenkins\jenkins.exe"
I was able to change the JENKINS_HOME variable following this http://tech.nitoyon.com/en/blog/2014/02/25/jenkins-home-win/
Setting JUST %JENKINS_HOME% as windows system wide environment variable didn't have any effect!
When you read Administering Jenkins you can read all options how to modify the JENKINS_HOME environment variable.
On this website you can read how to configure you Tomcat container to override the JENKINS_HOME environment variable, they advise to create the file $CATALINA_BASE/conf/localhost/jenkins.xml, with the following content:
Here is the answer that worked for me: Jenkins: How to change JENKINS_HOME on Windows