Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to move Jenkins from one PC to another

I am currently using Jenkins on my development PC. I installed it on my development PC, because I had limited knowledge on this tool; so I tested on it in my development PC. Now, I feel comfortable with Jenkins as my long term "partner" in the build process and would like to "move" this Jenkins to a dedicated server.

Before this I have done few builds and have the artifacts archived from each build. In particular, the build number is very important to me for version control.

How can I export all the Jenkins information from my current PC to my new server?

like image 442
huahsin68 Avatar asked Sep 30 '22 18:09

huahsin68


People also ask

Can we move or copy Jenkins from one server to another?

We can copy Jenkins from one server to another by simply copying the related directory. We can also use thin backup plugins to copy Jenkins from one server to another. We can copy Jenkins from one server to another by cloning the job directory by a different name.

How do I move Jenkins from one Jenkins to another?

According to the manual, https://wiki.jenkins-ci.org/display/JENKINS/Administering+Jenkins, it's simply to move the corresponding job directory to the new Jenkins instance. The "Copy existing Job" option requires the job to exist on the current Jenkins instance. It's an option to use the existing job as a template.


1 Answers

Following the Jenkins wiki, you'll have to:

  • Install a fresh Jenkins instance on the new server
  • Be sure the old and the new Jenkins instances are stopped
  • Archive all the content of the JENKINS_HOME of the old Jenkins instance
  • Extract the archive into the new JENKINS_HOME directory
  • Do not forget to change the owner of the new Jenkins files : chown -R jenkins:jenkins $JENKINS_HOME
  • Launch the new Jenkins instance
  • Do not forget to change documentation/links to your new instance of Jenkins :)

JENKINS_HOME is by default located in ~/.jenkins on a Linux installation, yet to exactly find where it is located, go on the http://your_jenkins_url/configure page and check the value of the first parameter: Home directory; this is the JENKINS_HOME.

like image 202
Cédric Julien Avatar answered Oct 02 '22 06:10

Cédric Julien