In the case where you want to copy a collection of jobs from one Jenkins server to another, here’s a process you can use to make the migration. This guide assumes you have two different remote Jenkins instances to copy jobs from.
SSH into the source server to determine where the
/jobs directory is for Jenkins. Example would be in /
scp (on your local machine) to copy the jobs from the remote Jenkins instance with the jobs:
After everything is downloaded, upload the files to the new server (you will need to upload them to the home directory of the user, and then move them via SSH):
After that completes, SSH into the server again and move the files:
Also, set the permissions of the jobs file over to the Jenkins service user:
After this is complete, go into Settings and Reload Configuration from Disk. Ensure that all of your previous jobs are in place.