To free up space on C:
, I would like to move my Jenkins data files (specifically the \jobs
directory) from the default installation directory C:\Program Files (x86)\Jenkins
to F:\Jenkins\home
. I think what I need to do is set the JENKINS_HOME
environment variable to F:\Jenkins\home
. But no matter what I try, the JENKINS_HOME
environment variable is always set to the location of jenkins.exe
.
Related:
- How to change Jenkins default folder on Windows?
- JIRA issue JENKINS-13530 JENKINS_HOME ignored on Bundled Windows EXE was closed as "not an issue"
Here is what I've tried so far:
- Moved jenkins data to F:\Jenkins\home
- Stop the running jenkins service
- Uninstall the jenkins service with
jenkins.exe uninstall
- Uninstall jenkins
- Delete
%HOMEPATH%\.jenkins
directory - Delete old jenkins install directory
- Download latest MSI installer
v1.597
- Installed to
C:\Program Files (x86)\Jenkins2
(renamed to ensure there are no stale values in the registry or config files) - Set system-level environment variable
JENKINS_HOME
toF:\Jenkins\home
- Set user-level environment variable
JENKINS_HOME
toF:\Jenkins\home
- Modified
jenkins.xml
to use<env name="JENKINS_HOME" value="F:\Jenkins\home"/>
- Started the Jenkins service
At this point, when I look at the system configuration, JENKINS_HOME
is set to C:\Program Files (x86)\Jenkins2
. So it seems it must always be set to the location of jenkins.exe
.
Maybe I've answered my own question. I'd like to have the program and data separate, if possible. Do I have to install jenkins to my F:\
drive? Or, is there a way to simply split off the jobs
directory and leave everything else on C:
?
Thanks!
EDIT : I did not have to move JENKINS_HOME
, but instead was able to configure the workspace and builds directories, which moved all the heavy disk usage over to F:
. The settings I chose were:
Workspace Root Directory = F:/Jenkins/workspace/${ITEM_FULLNAME}
Build Record Root Directory = F:/Jenkins/jobs/${ITEM_FULL_NAME}/builds
I manually migrated these directories so they would not have to be recreated. During this process I did lose my build history, but I'm okay with that for now.