Changing configuration after copying Jenkins from Production to non-prod server

We have recently created a non-Prod Jenkins server but standing up a new server, installing the same version of Jenkins that is in Production, and then doing an rsync from jenkins-data from Production to non-prod. We use the Gitlab Authentication Plugin, so when we login to Jenkins, we see the Gitlab login screen, enter Gitlab credentials, and then are allowed into Jenkins.
We have setup a non-Prod Gitlab server (all servers are on-prem). We are looking for ways to change the Global Gitlab OAuth Settings in Jenkins (under Manage Jenkins → Configure Global Security" at the file system level. Because we copied Production, all of the config is still pointing to Production in the Gitlab OAuth Settings.
Can anyone provide steps/suggestions on how we can update the config in the non-Prod Jenkins server without being able to actually login? Would we have to change our authentication method temporarily so we can login and then setup the Gitlab OAuth Settings?
Any help is appreciated!

If you’re using Jenkins Configuration as Code plugin you would have somewhere some yaml files describing your configuration.
If not Jenkins stores all config in xml files in JENKINS_HOME. So while Jenkins is not running just adjust the relevant xml files and then start Jenkins. If you need to adjust credentials this will be a bit more tricky.
You can also disable security in the config.xml (change useSecurity to false) and start Jenkins and then reconfigure the security realm.

1 Like