Jenkins: How to change JENKINS_HOME on Windows
If you install Jenkins using MSI installer, it copies files to C:\Program Files (x86)\jenkins and uses the install directory as JENKINS_HOME (on 64bit machine).
This means that Jenkins stores all data (including plugins, workspace and job data) to C:\Program Files (x86)\jenkins. On windows, it is recommended that application data is stored to ProgramData and AppData. So, I wanted to change JENKINS_HOME.
First, I added JENKINS_HOME to environment value, but it doen't make any sense. Jenkins prefers the value set on jenkins.xml when we use MSI installer.
Now, let's change JENKINS_HOME to C:\ProgramData\Jenkins (Jenkins version: 1.550).
Stop Jenkins service.
Open
jenkins.xmlin the install folder, and edit<env name="JENKINS_HOME" value="%BASE%"/>as follows:
<env name="JENKINS_HOME" value="%ProgramData%\Jenkins"/>Move all files in install folder except for the following files (Don't copy because it brokes symbolic links in
jobsfolder):jrefolderjenkins.err.logjenkins.exejenkins.exe.configjenkins.out.logjenkins.warjenkins.war.bakjenkins.war.tmpjenkins.wrapper.logjenkins.xml
Start Jenkins service.
Open
http://localhost:8080/systemInfoand checkJEKNINS_HOMEhas been changed.
Enjoy!