O'Reilly logo

Jenkins: The Definitive Guide by John Ferguson Smart

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Migrating Build Jobs

There are times when you need to move or copy Jenkins build jobs from one Jenkins instance to another, without copying the entire Jenkins configuration. For example, you might be migrating your build jobs to a Jenkins instance on a brand new box, with system configuration details that vary from the original machine. Or you might be restoring an old build job that you have archived.

As we have seen, Jenkins stores all of the data it needs for a project in a subdirectory of the jobs directory in your Jenkins home directory. This subdirectory is easy to identify—it has the same name as your project. Incidentally, this is one reason why your project names really shouldn’t contain spaces, particularly if Jenkins is running under Unix or Linux—it makes maintenance and admin tasks a lot easier if the project names are also well-behaved Unix filenames.

You can copy or move build jobs between instances of projects simply enough by copying or moving the build job directories to the new Jenkins instance. The project job directory is self-contained—it contains both the full project configuration and all the build history. It is even safe enough to copy build job directories to a running Jenkins instance, though if you are also deleting them from the original server, you should shut this one down first. You don’t even need to restart the new Jenkins instance to see the results of your import—just go to the Manage Jenkins screen and click on Reload Configuration From Disk. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required