After getting annoyed with the outdated packages on CentOS 5.6 I decided to migrate my Jenkins server to Ubuntu 16.04.
It was surprisingly straightforward:
Backup the old Jenkins server in case something goes wrong.
Install Jenkins on the new server (guide):
wget -q -O - https://pkg.jenkins.io/debian/jenkins-ci.org.key | sudo apt-key add - sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list' sudo apt-get update sudo apt-get install jenkins
/var/lib/jenkinsfolder on the old server to the new one by running this command from the new Jenkins server (where
188.8.131.52is the old server’s IP and
useris the old server’s ssh user):
rsync -av [email protected]:/var/lib/jenkins /var/lib --exclude workspace/ --exclude cache/ --exclude .cache/ --exclude node_modules/ --exclude .npm/
I excluded some directories to speed up the process but thats up to you. Check out this guide for more on using
systemctl restart jenkins