This worked for me to move from Ubuntu 12.04 (Jenkins ver. 1.628) to Ubuntu 16.04 (Jenkins ver. 1.651.2). I first installed Jenkins from the repositories.
Copy JENKINS_HOME
(e.g. /var/lib/jenkins) from the old server to the new one. From a console in the new server:
rsync -av username@old-server-IP:/var/lib/jenkins/ /var/lib/jenkins/
You might not need this, but I had to
Manage Jenkins
and Reload Configuration from Disk
.Configure System > Jenkins Location
, the Jenkins URL
is correctly assigned to the new Jenkins server.