5

Just installed latest Jenkins on Windows server.
Changed it to run as a service and my login no longer works. No problems, disable security for now.

But found out all my plug-ins are missing.
How can I have it rerun the setup wizard?

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
mark1234
  • 1,110
  • 2
  • 24
  • 41

2 Answers2

2

As seen in issue 310, you need on the server side to remove:

/usr/share/jenkins/ref/jenkins.install.UpgradeWizard.state
/usr/share/jenkins/ref/jenkins.install.InstallUtil.lastExecVersion

(Search those files on your Windows Jenkins installation folder, to adapt those paths accordingly)

And you would relaunch Jenkins with -Djenkins.install.runSetupWizard=true

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
2

I installed Jenkins through apt and my solution was a little different.

For Jenkins v2.140 I had to edit /var/lib/jenkins/config.xml and change the following line:

<installStateName>NEW</installStateName>

to

<installStateName>RUNNING</installStateName>

then restart Jenkins:

sudo service jenkins restart

Here is everything above in a script:

#! /bin/bash

sudo sed -i 's#<installStateName>NEW.*#<installStateName>RUNNING<\/installStateName>#g' /var/lib/jenkins/config.xml
sudo service jenkins restart

Please note you will have to install all plugins and create users manually. I used the Jenkins CLI

Jeff Diederiks
  • 1,315
  • 13
  • 20
  • 1
    My solution is exactly the opposite - change from `RUNNING` to `NEW` will let me see the wizard again :) – ch271828n Mar 01 '20 at 13:30
  • As above, pretty sure you meant to say the opposite. You need to change that value from RUNNING to NEW. – xIcarus Nov 30 '20 at 19:57