Jenkins Migration Guide: Environment Preparation and Step-by-Step Procedure
This article provides a detailed Jenkins migration guide, covering environment preparation, Tomcat configuration, permission settings, script adjustments, data copying, and troubleshooting tips to ensure a smooth transition to a new production server.
Jenkins is widely used in testing, and migration becomes necessary due to machine decommission, resource constraints, or task conflicts.
Environment preparation : Install Tomcat, JDK, and other Jenkins dependencies on the new machine; multiple independent Jenkins instances can run on the same host if resources are limited.
Steps:
Copy the Tomcat installation package to the target directory and modify conf/server.xml to change three ports, ensuring they are free.
Give execution permission to Tomcat's bin scripts: chmod +x *.sh.
Add the new Tomcat paths to ~/.bash_profile:
export CATALINA_BASE2=/home/xxxx/software/apache-tomcat-7.0.59 export CATALINA_HOME2=/home/xxxx/software/apache-tomcat-7.0.59then run source ~/.bash_profile.
Edit startup.sh and shutdown.sh as needed (details omitted).
In catalina.sh, set the Jenkins home directory to avoid using the default ~/.jenkins, which could conflict with the previous instance.
Start Jenkins with sh startup.sh.
After the environment is ready, copy the original Jenkins home directory (including config.xml, jobs, users, workspace, and plugins directories) to the new location, then restart Jenkins. Ensure file ownership is changed to the Tomcat user (e.g., chown -R tomcat:tomcat <directory>) to prevent permission issues.
If problems arise during startup, check the Jenkins log directory for clues such as port conflicts.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
360 Quality & Efficiency
360 Quality & Efficiency focuses on seamlessly integrating quality and efficiency in R&D, sharing 360’s internal best practices with industry peers to foster collaboration among Chinese enterprises and drive greater efficiency value.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
