0
votes

I am copying Jenkins jobs from one instance to the other. I created a folder called " Old_Jobs" in the destination instance under jobs directory. If I copy all the jobs under this Old_jobs directory and reload configuration from disk, I can't see those jobs in the Jenkins GUI. However, if I copy those jobs under the "jobs" directory, I can see all the jobs in Jenkins GUI.

Is there any way I can see all my copied jobs under /var/lib/jenkins/jobs/Old_Jobs/ directory?

Note- I have tried changing permission to 777 in the destination folder, but it didn't work. Ownership is also correct in the destination instance.

1

1 Answers

0
votes

AFAIK, all the jobs are listed under /jobs/ Since you have created one more directory, "Old_Jobs" under /jobs, the required structure is not present.

Also, I remember facing similar issue (even with keeping same directory structure) and I had to copy "/workspace" folder as well to the new instance.

You can refer required directory structure over here : https://wiki.jenkins.io/display/JENKINS/Administering+Jenkins

enter image description here

It also mentioned below points:

Moving/copying/renaming jobs You can:

  1. Move a job from one installation of Jenkins to another by simply copying the corresponding job directory.
  2. Make a copy of an existing job by making a clone of a job directory by a different name.
  3. Rename an existing job by renaming a directory. Note that the if you change a job name you will need to change any other job that tries to call the renamed job.

Those operations can be done even when Jenkins is running. For changes like these to take effect, you have to click "reload config" to force Jenkins to reload configuration from the disk.