How do I move Jenkins from one server to another? - jenkins

I need to move Jenkins version 2.32 from Server A to Jenkins 2.72.1 Server B.
Both server have ubuntu 16.04.3
I could not install any plugin and take back up in Server A due to memory issues. Is there any way that I could achieve this?

Copy all the files in your JENKINS_HOME directory over to the new server.
Point JENKINS_HOME on the new server at the new directory.
Copy the Jenkins war file (or your servlet container setup if you have one) over to the new machine and start it up.
All Jenkins settings, jobs, plugins, config, etc. live in JENKINS_HOME. You just need a copy of it to start it elsewhere.

Following JENKINS/Administering+Jenkins, you still need to make a backup of JENKINS_HOME.
See also How to Migrate a Jenkins Job to New Jenkins Server
If you want to exclude the plugins for space issue, you can list them in a text file, and reload them with a groovy script.

Related

How to build a jenkins pipeline choosing 4 path options to copy .war files to a selected tomcat's webapps folder?

I am new on jenkins and I have this situation here. Devs used to deploy by themselves .war files to various paths using a type of manual versioning.
I put my server with NFS share with those repository of files and I would like to build a pipeline choosing different paths to deploy files in my tomcat server.
If a Dev do a new version I just update this new path. But I need to do it selecting pre inserted paths as a choice. I need to deploy those new files selecting paths in a parameterized pipeline.
So I can do deploys just choosing a selection of paths to same tomcat server.
It is hard to start it. I configured my Jenkins docker container and it can execute remote test jobs well.
I need to write this type of pipeline and I really got some problems to join all pieces together.
Or if it is possible I just pass the NFS absolute path to this job as a parameter when I start to execute this pipeline to make it very flexible.
How can I start? I installed some plugins like File Operations and Send Files and execute ssh commands over SSH but it is hard to build it.
Any help or way or links to study it is appreciated.

How to Move jenkins with all plugin,Jobs and all other configuration to another server in cloud

Need expert help on this.I have a task to move on premises jenkins to GCP Cloud server and need exact replica of the Jenkins.Can someone help me on this.I want all plugins ,configuration and jobs to be present in new GCP machine and it should be exact replica of the on premise jenkins server so that we can shut down the on premise machine.
I got this instructions that seems to be correct:
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
Launch the new Jenkins instance
Do not forget to change documentation/links to your new instance of
Jenkins :)
Do not forget to change the owner of the new Jenkins files : chown -R
jenkins:jenkins $JENKINS_HOME
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.
You can review the details in this link, an also this link with 3 methods that you could use.

Migrate from jenkins 1 to jenkins 2

How can we migrate our jenkins 1 instance to jenkins 2.
We know the job export plugin which can be useful for all our the jobs but is there also a way to export your general settings / security settings?
Jenkins 2 is a drop-in replacement. You can just upgrade from version 1 to 2, either by updating the server running Jenkins, or by copying the Jenkins directory.
Don't export anything. Jenkins stores EVERYTHING in 1 directory (unless you have told it not to). Copy that entire directory to a new machine. Copy the existing jar. Start up Jenkins. If it works, replace the jar with the new version. Start it up. Chances are, it will just work.

Jenkins version upgrade from 1.613 to latest one

I want to upgrade my Jenkins version from 1.613 to latest one i.e 2.80 , As my current Jenkins version is 2 years old, I see My java version is 1.7 and I want to upgrade the java version as newer Jenkins version needs Java 1.8 , Is there anyway I can upgrade my Jenkins without any downtime and without a mess ..? I am afraid I cant roll back java Once I upgrade it to 1.8 and also I am afraid of all plugins. What necessary action I need to take ..? I see my Jenkins is in /var/lib
Please help me guys
Thanks
If you just keep a backup of your original war file and your entire JENKINS_HOME directory, your risk is minimal if something goes wrong.
Something like this should make it pretty easy:
Try it all on a backup server first, though this is optional:
Copy the jenkins war file and the JENKINS_HOME directory to a new machine, set the JENKINS_HOME variable to point to the place you copied JENKINS_HOME to, then start Jenkins. Make sure it all works like it should. You can even make a copy on the same machine but in a different directory if you start it up on another port. Now you can try the upgrade steps on non-production instance.
The actual upgrade should be fairly painless. Shut down Jenkins, make a backup of everything, then start Jenkins using the new war file. Log in and test. If something doesn't work, remove the JENKINS_HOME and replace with your backup. Start back up with the original war file.

Jenkins service won't start after backup

My organization needs to make backups of our heavily customized Jenkins instance. After doing some research on different methods for backing up Jenkins, we decided to go the route of copying the whole Jenkins directory using xcopy and then moving the backup to a new instance on a different machine. (The reason for using xcopy is that its the only way to preserve they symbolic link files within each job.)
Here's the steps I have taken:
A batch file uses xcopy to copy the entire D:\Jenkins directory on a nightly basis from the old machine
I install a fresh instance of Jenkins on a new server
I stop the Jenkins service from running
I delete the current Jenkins directory in the new machine and then xcopy the backup in its place
I attempt to start the Jenkins service and I am met with the following error:
The Jenkins service on Local Computer started and then stopped. Some
services stop automatically if they are not in use by other services
or programs.
I have tried running jenkins.war from the command line and that just causes a Jenkins instance to start up that doesn't register as a windows service, and I cannot login to (even after disabling useSecurity), and looks like it doesn't have our modifications present.
I have also tried clearing the application log and that did not help.
I am not sure how to get the Jenkins service up and running.
The one folder you need to backup is the one referenced by the environment variable JENKINS_HOME
It is best to keep that folder separate from the installation folder like C:\Program Files (x86)\jenkins.
Then I prefer using a tomcat instance, and copy the jenkins.war in it: it is easier to upgrade:
Simply overwrite your jenkins.war with the new version. Tomcat should automatically redeploy the application.

Resources