Tuesday, June 2, 2020

Migrate jenkins jobs from one server to another | Migrate Jenkins jobs from one Jenkins server to another Jenkins server

How to migrate Jenkins jobs from one Jenkins instance to another Jenkins instance?
Jenkins jobs can be migrated in many ways. You can establish SSH connection b/w source machine and target machine and use scp command to copy from one instance to another instance. You can also use Job import plug-in to migrate jobs.

Pre-requisites:

Make sure you install job import plugin in target Jenkins instance.

Steps to migrate jobs from source Jenkins to Target Jenkins instance:

Make sure you have right Jenkins source URL by logging to Source Jenkins.
Click on Manage Jenkins --> Configure System
Copy the Jenkins URL.
Logout from source Jenkins.

Steps in Target Jenkins
1. Login to Target Jenkins
2. Go to Manage Jenkins -->configure system--> click on Job import plug-in
Add source Jenkins url and login credentials.


3. Click on Save
4. Go to Jenkins -->Job Import plug-in
 5. Select source Jenkins from down and check search into folder option
  click on Query

6. Now it should pull all the jobs, choose the jobs you would like to migrate and click on Import.
Make sure you choose install required plug-ins option as well.
 Now you should see the message.
7. Go to Jenkins home page and refresh it. You should see the jobs migrated successfully.
You can watch the steps in my YouTube channel as well:

Note: Please note that Credentials will not be migrated, only Jobs and plug-ins will be migrated.

2 comments:

  1. Getting below error while import job:

    FAILED - PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

    ReplyDelete

DevSecOps Bootcamp Dec 2024 Schedule | DevSecOps & AWS Azure Cloud Coaching by Coach AK | DevSecOps and Cloud Computing Online Classes

Lot of new topics covered like GitHub Actions, GitHub Advanced Security, Helm, Prometheus and Grafana..) The DevOps requirements in the IT m...