How to Migrate Jenkins from Windows Server 2012 to Windows Server 2019

Migrating Jenkins from Windows Server 2012 to Windows Server 2019 involves installing a fresh Jenkins instance on the new server and transferring configuration data from the old one. Here's a general guideline:

Preparation:

  1. Install Jenkins on Windows Server 2019: Download the latest LTS (Long-Term Support) version of Jenkins .war file from the official Jenkins website https://www.jenkins.io/download/. Install it on your new Windows Server 2019 following the standard installation process.

  2. Backup Jenkins Configuration (JENKINS_HOME): On your Windows Server 2012 Jenkins instance, locate the directory JENKINS_HOME. This directory contains all your Jenkins configuration data, including jobs, plugins, and user settings. You can find the location of JENKINS_HOME by going to Jenkins dashboard -> Manage Jenkins -> System Information. Create a compressed archive (e.g., zip) of the entire JENKINS_HOME directory.

Migration:

  1. Stop Jenkins services: Ensure Jenkins services are stopped on both the old (Windows Server 2012) and new (Windows Server 2019) servers.

  2. Transfer Configuration Archive: Copy the compressed archive of JENKINS_HOME from the old server to the new server.

  3. Restore Configuration on New Server: Extract the archive contents into the new server's JENKINS_HOME directory. This will overwrite the default Jenkins configuration with your existing settings.

  4. Adjust Permissions (Optional): Depending on your setup, you might need to adjust file permissions on the new server's JENKINS_HOME directory to ensure the Jenkins service user has proper access.

  5. Start Jenkins on New Server: Start the Jenkins service on your Windows Server 2019 machine.

Post-Migration:

  1. Test and Verify: Once Jenkins starts, log in to the new Jenkins web interface and verify that your jobs, plugins, and configurations are present and functional.

  2. Security Considerations: If you had user authentication enabled on the old Jenkins, you might need to adjust security settings on the new server. Consider temporarily disabling security (<useSecurity>false</useSecurity> in config.xml) to access the new Jenkins initially and then re-configure security as needed.

Additional Tips: