I used Perl to automate such processes using the CLI (go to $jenkins_URL/cli/ and download the Jenkins-cli.jar) (script changed to your scenario)
It is important to make sure that you have all necessary plug-ins installed on your new Jenkins otherwise any migration method won't work...
my $newJobPrefix = "New_Jenkins";
my $jobPrefix = "Old_Jenkins";
my $result = `"$java" -jar old-jenkins-cli.jar -noKeyAuth -s $jenkins_URL list-jobs All`;
@jobList = split("\n", $result);
foreach my $job (@jobList)
{
# ---- Getting configuration of jobs ----
print "Getting config for: $job \n";
my $config = `"$java" -jar $jenkinsJar -noKeyAuth -s $jenkins_URL get-job $job`;
my $file = "$jobPrefix\\$job.xml";
unless(open FILE, '>', $file) {die "Unable to open $file";}
print FILE $config;
close FILE;
# ---- Adding Job to new Jenkins ----
my $result = `"$java" -jar new-jenkins-cli.jar -noKeyAuth -s $New_jenkins_URL create-job $job< $file`;
}
Good luck!