Moving a Jenkins Instance From one Server to Another

During my time converting ZDirect’s SVN repo to Git, we decided to move our code from a server in Florida to a server in Ottawa. The same server also hosts our Jenkins build server. To keep bandwidth bills and build latency down we’re moving the Jenkins server over as well.

Trial and error led me to copying the entire Jenkins directory, which is either at the JENKINS_HOME environment variable or ~/.jenkins as the default. Launching the Jenkins executable while setting the JENKINS_HOME environment variable will bring up an almost perfectly configured instance of Jenkins. I say almost because the Jenkins configuration should be looked over for any settings that are wrong for this new system. Some Jenkins configuration options that I had to change was the JDK home, Ant home and the external url of the server. An example launch script looks as follows:

$ JENKINS_HOME=/path/to/jenkins/home/folder
$ java -jar jenkins.war

The Jenkins Wiki outlines how to move specific jobs as well.

Published by

Jon Simpson

I'm a software engineering professional interested in Continuous Delivery, Lean, hipster programming languages, and distributed computing. In my spare time I enjoy reading books, tasting craft beers, and exploring Canada's capital. I have a Bachelors of Computer Science with a specialization in Network Computing from Carleton University, Ottawa.

Leave a Reply