Jenkins setup:
Hello team,
We have working on setting up new version of jenkins in a separate box without touching the existing one. From the ols jenkins we get an ebs volume and attach to the new instance and perform sync using python msrsync. This will sync all the jobs from existing jenkins to new one.
However we see few issues like, some old folders are getting displayed in new jenkins but this does not exist in current jenkins. Those folders are with same name in uppercase and lowercase.
Eg: ABCSCRIPTS was created earlier and then renamed this to abcscripts. but after the sync, it is showing both the folders.
One more thing is, it is showing all the old deleted branches as well.
Can someone suggest here why is this happening.
Thanks
First of all check the $JENKINS_HOME/jobs directory on the EBS volume.
Custom build directories could cause renamed files to not be fully cleaned up.
or an EBS volume snapshot was taken at a point where both directories existed.
The second issue involves old deleted branches appearing in the new Jenkins. This is likely related to multi-branch pipeline jobs, where Jenkins tracks branches from a repository. By default, Jenkins does not automatically prune deleted branches unless configured to do so via the “Discard old items” option. If this setting was enabled in the old Jenkins but not properly synced or applied in the new instance, deleted branches could still be visible.
My suggestion is checking the file system to verify if there are any hidden files that were not fully cleaned up
For the second issue go to the new Jenkins, navigate to the job configuration and ensure the “Discard old items” option is enabled, which includes pruning deleted branches. After syncing, trigger a rescan of the repository to apply these settings, ensuring deleted branches are removed from view.
This can be done via the Jenkins UI under the job’s “Scan Repository Now” option, ensuring the configuration is correctly applied.