Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Hudson » Possible to Export Jobs?
Possible to Export Jobs? [message #1717664] Tue, 15 December 2015 15:42 Go to next message
Shelli Orton is currently offline Shelli OrtonFriend
Messages: 101
Registered: September 2009
Senior Member
Hi,

We were running Hudson on an older Linux server and when we tried to upgrade to v.3.3.2 we started encountering issues with older OS libraries that there wasn't upgrades for. So, we have set up a new server and have installed Hudson on it. There's quite a lot of jobs on the old server and recreating them manually on the new one will be a big task.

The question is, is there a way to export or migrate our jobs from the old server to the new one?

Thanks!
Re: Possible to Export Jobs? [message #1717677 is a reply to message #1717664] Tue, 15 December 2015 18:43 Go to previous messageGo to next message
Bob Foster is currently offline Bob FosterFriend
Messages: 85
Registered: January 2013
Member
You can get the config.xml for a job on older system by, e.g.,

http://localhost:8080/job/Job1/config.xml > config.xml

Where localhost:8080 is replaced with your Hudson server host name.

Then for non-team jobs, you can use createItem to POST the config.xml as documented in the /api/ at:

http://localhost:8080/api/

For team or non-team jobs, you can also use the CLI:

java -jar hudson-cli.jar create-job args...
Creates a new job by reading stdin or file as a configuration XML file
NAME : Name of the job to create. The job name should not be
team qualified. Ex: job1.
TEAM : Team to create the job in. Optional.
-file VAL : Read config.xml from file rather than standard input.
--username VAL : User name to authenticate yourself to Hudson
--password VAL : Password for authentication. Note that passing a
password in arguments is insecure.
--password-file VAL : File that contains the password

See also 'java -jar hudson-cli.jar login' so you don't have to specify credentials each time.

It is possible to script this with a little effort. E.g., the CLI list-jobs command will list all the jobs on a server, etc.

Re: Possible to Export Jobs? [message #1717911 is a reply to message #1717677] Thu, 17 December 2015 16:55 Go to previous message
Shelli Orton is currently offline Shelli OrtonFriend
Messages: 101
Registered: September 2009
Senior Member
Thanks!
Previous Topic: java.lang.NoClassDefFoundError: org/eclipse/core/launcher/Main
Next Topic:Embeddable Build Status plugin for Hudson
Goto Forum:
  


Current Time: Wed Aug 16 13:18:19 GMT 2017

Powered by FUDForum. Page generated in 0.03665 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software