Thank you so much for the instructions. I'm sure this will be a great aid
to many users in the community. Unfortunately, it did not work. I've tried
it from 3 different boxes (1 aix, 1 centos and a windows box) and received
the same exception:
Exception in thread "main" java.io.EOFException: unexpected stream
termination
at
hudson.remoting.ClassicCommandTransport.create(ClassicCommandTransport.java:100)
at hudson.remoting.Channel.<init>(Channel.java:373)
at hudson.remoting.Channel.<init>(Channel.java:369)
at hudson.remoting.Channel.<init>(Channel.java:330)
at hudson.remoting.Channel.<init>(Channel.java:326)
at hudson.remoting.Channel.<init>(Channel.java:314)
at hudson.cli.CLI.connectViaHttp(CLI.java:151)
at hudson.cli.CLI.<init>(CLI.java:134)
at hudson.cli.CLI.<init>(CLI.java:107)
at hudson.cli.CLI._main(CLI.java:395)
at hudson.cli.CLI.main(CLI.java:330)
Any ideas on how to perform the copy manually then? I guess i'll have to do
this job by job at this point.. I only have about 20 jobs to move :)
On Friday, February 28, 2014 12:57:50 PM UTC-5, Patricia Wright wrote:
>
> You can test to see if this has a hope of working by doing the following:
>
> 1) check to see if the CLI works:
>
> java -jar jenkins-cli.jar -s JENKINS_URL who-am-i
> --username=YOUR_USERNAME --password=YOUR_PASSWORD
>
> Replace YOUR_USERNAME and YOUR_PASSWORD as appropriate.
>
> 2) If that works and doesn't give you exceptions, you can run something
> like the following:
>
> java -jar jenkins-cli.jar -s JENKINS_URL list-jobs
> --username=YOUR_USERNAME --password=YOUR_PASSWORD
>
> This should give you a list of jobs.
> Replace "list-jobs" with "get-job SOME_TEST_NAME" and it will spit out
> a pile of XML at you.
>
> 3) Doing the transfer
>
> If all that works, and assuming you have access to create jobs on new
> jenkins server, and that server has all the needed plugins/prerequisites.
> You can use the following script:
>
> Edit the 4 variables at the top as appropriate (this assumes Mac, or
> some other unix)
>
> Disclaimer, use at your own risk, of course. I don't know your
> environment.
> I did something similar to this in order to migrate from a windows
> master to a linux master (I modified the xml files for my own needs).
>
> #!/bin/bash
>
> OLD_JENKINS_URL=http://oldjenkins.somedomain.com
> NEW_JENKINS_URL=http://newjenkins.otherdomain.com
> YOUR_USERNAME='replace_here_with_username'
> YOUR_PASSWORD='replace_here_with_password'
> WORKDIR="/tmp/transfer.$$"
> mkdir -p $WORKDIR
>
> java -jar jenkins-cli.jar -s $OLD_JENKINS_URL list-jobs --username
> "$YOUR_USERNAME" --password "$YOUR_PASSWORD" > testlist.txt
> for job in `cat testlist.txt` ; do
> echo Copying job $job
> java -jar jenkins-cli.jar -s $OLD_JENKINS_URL get-job $job --username
> "$YOUR_USERNAME" --password "$YOUR_PASSWORD" > $WORKDIR/$job.xml
> java -jar jenkins-cli.jar -s $NEW_JENKINS_URL create-job $job
> --username "$YOUR_USERNAME" --password "$YOUR_PASSWORD" < $WORKDIR/$job.xml
> done
>
> ------------------------------
> *From: *"SamiSam" <[email protected] <javascript:>>
> *To: *[email protected] <javascript:>
> *Cc: *[email protected] <javascript:>
> *Sent: *Friday, February 28, 2014 12:23:28 PM
> *Subject: *Re: Best practice to copy Jenkins jobs from old instance to
> new one - Different networks - No root access to server - Manual Copying
> preferred
>
> oh interesting.
>
> I just downloaded jenkins-cli.jar -- a few questions Patricia
>
> the first line: java -jar jenkins-cli.jar -s
> https://oldjenkins.yourdomain.com<https://urldefense.proofpoint.com/v1/url?u=https://oldjenkins.yourdomain.com&k=oIvRg1%2BdGAgOoM1BIlLLqw%3D%3D%0A&r=P%2FDbhm7GMaM%2FtPTZjlK%2F8lebpERVSZcf2B%2BqCod7tGs%3D%0A&m=j0Ae%2BeF%2BRNGrNlpD0C56dx7dXdA2B0lX8o5EA2iHX8M%3D%0A&s=0308fa11adcc235bc63caa1531fa32fd073a477945c787462b4de65840d5439f>
> login
> - will the login be user:password ?
>
> if so, nothing happens on my end. Should i copy and modify your
> instructions into a file and execute? Sorry, I'm not a developer but an
> Integrator.
>
> Thank you
>
>
>
>
> On Friday, February 28, 2014 11:50:40 AM UTC-5, Patricia Wright wrote:
>>
>> Just so I am clear, I'm not referring to the cli of the jenkins server
>> itself.
>>
>> The CLI I refer to is the remote jenkins command line.
>>
>> You can download the .jar file from $JENKINS_URL/jnlpJars/jenkins-cli.jar
>> and run it on any machine.
>>
>>
>>
>> ------------------------------
>> *From: *"SamiSam" <[email protected]>
>> *To: *[email protected]
>> *Sent: *Friday, February 28, 2014 11:45:44 AM
>> *Subject: *Re: Best practice to copy Jenkins jobs from old instance to
>> new one - Different networks - No root access to server - Manual Copying
>> preferred
>>
>> Thanks for the suggestion Patricia.. Unfortunately, no access to CLI.. I
>> could have easily copied the directory where the jobs reside in and call it
>> a day.. but that's no an option. sigh
>>
>>
>> On Friday, February 28, 2014 9:56:42 AM UTC-5, SamiSam wrote:
>>>
>>> Hi there,
>>>
>>> Can someone recommend a way to copy Jenkins jobs from an old server to a
>>> new one? Unfortunatley, I don't have root access to the old server, so
>>> copying the directories is not an option. Using a plugin might not be an
>>> option either. Can this be performed manually? Any help would be greatly
>>> appreciated!
>>>
>>> Thanks in advance
>>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Jenkins Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> For more options, visit
>> https://groups.google.com/groups/opt_out<https://urldefense.proofpoint.com/v1/url?u=https://groups.google.com/groups/opt_out&k=oIvRg1%2BdGAgOoM1BIlLLqw%3D%3D%0A&r=P%2FDbhm7GMaM%2FtPTZjlK%2F8lebpERVSZcf2B%2BqCod7tGs%3D%0A&m=v%2BfNRUqp7dfvt06eL51Ls8IEoMSYvvMjjCyLKO8xtHU%3D%0A&s=3ebd74b1757cdf0bd95552e6d8011e89016788a02863b7d012099c2eeaae5801>
>> .
>>
>>
>
--
You received this message because you are subscribed to the Google Groups
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.