Renistall of Jenkins on Windows - jenkins

I may need to reinstall Jenkins on a Windows Server 2008 R2 Enterprise server. If I run the installer for an already installed version, it gives me the option of uninstalling. I've already tried the "repair" option but it didn't solve my problem. If I do the uninstall, what will happen to my existing jobs and their history? Will the entire Jenkins folder be deleted? If so, will I be able to restore them from a backed up copy?

I'm not sure about Windows, but I think in linux, the jobs/configs directory can be copied across multiple Jenkins installations. Make a backup of your jenkins home directory first. The Jenkins executable itself is less critical, as it can easily be reinstalled without affecting your build environment. See this link for more information: https://wiki.jenkins-ci.org/display/JENKINS/Administering+Jenkins

Yes, you can restore them by backing up your jenkins install folder and then copying the contents back to the jenkins install folder after reinstallation. This works for linux or windows. All job info and configuration is stored on the file system.

Related

Jenkins install plugins offline

Installed Jenkins on a Linux server and want to install some plugins manually.
I want to install Blue Ocean and Artifactory.
For both plugins I downloaded the hpi file and tried to install it, but I get a lot of dependency errors.
Do I now have to install those dependencies manually as well? or is there a better way to do this?
I tried to install one of those dependency and that one also had some dependency errors as well :-(
The Linux server is not able to access the internet.
Thanks!
Robert
You are correct that BlueOcean has a lot of dependencies.
Given you are not able to connect to the internet you will need to download all 21 BlueOcean related hpi files and upload them from the Manage Jenkins > Manage Plugins > Advanced tab.
Alternatively, if you have access to the server that your Jenkins instance is running on you can copy the hpi files into the %JENKINS_HOME%/plugins folder. The corresponding directories (exploded from the hpi, which is just a zip file) will be created on Jenkins restart.
The easiest way to acquire all 21 plugin files is to open The Jenkins plugin page and search for blueocean. Download the same numbered version of all 21 and upload them one by one. Order shouldn't be an issue. As long as they are all present on restart the dependencies will resolve.
Same process goes for any other plugin. If you're able to get the machine connected to the internet it will make the process a lot simpler as you will be able to use the update center, which manages dependencies and update notifications.
Same case here. Our Jenkins is setup in OpenShift which is not allowed to connect to the Internet. Downloading a plugin 1-by-1 is tiresome. Not to mention that each plugins have its own dependencies that needs to be downloaded as well.
Here's what you would do...
Run a Jenkins locally in a machine that can download plugins.
Download and update all the plugins you want using the Update Center.
Go %JENKINS_HOME%/plugins directory. Inside this folder you would see *.jpi. These are your plugins. Its dependencies will be downloaded as well.
Rename it to *.hpi then keep it in some directory.
To test...
In your local Jenkins delete everything in %JENKINS_HOME%/plugins directory then put all *.hpi in this directory.
Restart your local Jenkins.
Verify if the plugins you require are installed and updated.

Update jenkins war on one machine and then move it to another one: possible?

I have a machine with blocked outgoing connections so it is not possible to update jenkins nor install the plugins I need for my work.
My idea is the following: I download the jenkins .war on my personal laptop and complete the installation + the plugin download.
Then I just move this .war to the machine where I need jenkins to be up and running.
Is it possible? Where are the plugins/updated data stored?
Also, would it be a problem the fact that my laptop has windows as os, while the destination machine is a linux RHEL?
Your solution sounds crazy :D
This could be help you:
Update Jenkins war
If you have shell access with root privilege, there is a manual way.
Download latest war file inside your linux, using wget , curl or just upload it using winscp from your windows.
Stop jenkins
Backup EVERYTHING: linux snapshot, jenkins workspace, jenkins war file, etc
Replace the old war with new war
Start jenkins
Detailed steps in this webs:
https://mohitgoyal.co/2017/02/15/upgrade-jenkins-server-to-a-new-version/
https://www.thegeekstuff.com/2016/06/upgrade-jenkins-and-plugins/
Plugin
Jenkins has an option to install plugins called Manage Plugins
This offer two options :
(1) Install plugins using available option
For official and compatible plugins, suggested by Jenkins :
(2) Install plugins using upload option
For custom plugins or when is not available on official repositories:

How to install jenkins offline?

I could successfully install the jenkins online over my laptop. But while trying to install the jenkins offline (on my office workstation which cannot be connected to internet) the hell breaks loose.
After running the jenkins.war over command line although the jenkins was successfully installed yet some of the plugins were missing.I managed to get some help from the post How to install a plugin in Jenkins manually?
But then each of the plugins have to be individually downloaded and then copied over to my offline machine. So I had a trick.
I copied all the folders under .jenkins directory (in my online installation machine) and then copied them to my offline machine. Whoa!
It worked!
But I still get one single error:
Maven Integration Plugin V2.16 .javadoc 1.0 is missing. To fix, install v1.0 or later
So is there a way/website/pdf/repository which is a one stop solution/steps to smoothly install (read has all the required dependencies as a zip) Jenkins in offline mode. (If not, to the creators of Jenkins: Would it be a good idea to have one?)
I'm also searching for an easy way to manage the dependencies between the plugins but as far as I know there is no official tool for that.
Either you have a .zip file with all the plugins which you prepare one time or you fix the errors manually.
For your problem it should be enough to install the following .hpi file: https://updates.jenkins-ci.org/latest/javadoc.hpi (javadoc has no dependencies to other plugins)
You can download the .hpi version of plugins required and paste them in plugins folder at jenkins_home and then restart the jenkins,then you can able to use those plugins.

Jenkins : Windows build to Windows host : which plugin to use?

I have found many examples of Linux to Windows or OSX to Windows, but battling to find how to copy build files from a Windows server installation of Jenkins, to the
Windows server which will host the website.
I tried Copy Artifact Plugin - but it seems this is used to copy other builds into the current build - is this correct?
Or can it be used to copy the build that just execute to a remote Windows folder?
What should I use to copy to another Windows server?
I would like to not use batch files. Can/should powershell be used?
The idea would be to copy the files to a timestamped folder on the hosting Windows server
e.g.
xcopy *.* \\MyHostingServer\Temp
Then only after everything has copied successfully - to copy the files from MyHostingServer\Temp into the correct web folder. This is to prevent the deployment to the web folder if e.g. network connection was lost halfway.
I am having a really hard time getting Windows specific information.
I suggest to use two jobs:
build job is running on the first Windows server. Archive your build files as an artifacts to the job
deployment job should run on second Windows server. You can use "Copy artifacts from another project" to get your build files locally (on second server)

Upgrade to Jenkins 2.0 on Windows Server

We are currently running version 1.651.3 on our server and want to upgrade to version 2. From what I can tell online, I just need to run the .msi file and install into the current Jenkins directory and we're good. That didn't work, so I tried stopping the Jenkins service and installing again, but it is still running the old version. What am I missing?
So I didn't realize that you could just download the .war file instead of one of the deployment options. I was clicking Windows and getting the .msi instead of clicking 2.11 .war and getting the .war file. I then dropped this into the C:\Program Files (x86)\Jenkins directory on my server and all was good in the world.

Resources