Feature #1385

Script for import from JIRA

Added by Charles L about 9 years ago. Updated over 2 years ago.

Status:NewStart date:2008-06-05
Priority:NormalDue date:
Assignee:-% Done:

90%

Category:Importers
Target version:-
Resolution:

Description

I've attached "migrate_from_jira.rake", which was modeled on both the trac migration script, and jira2trac.rb which can be found at trac's home page.

Though it isn't as polished as it could be, it gives better fidelity than jira2trac.rb + migrate_from_trac.rake, and hopefully it servers as a good starting point for any other tweaks needed to do a decent import.

It currently takes as input (as per jira2trac.rb), an xml dump of issue info from jira. Based on that, it imports projects, sub-projects, users, issue categories, issues, and issue comments.

migrate_from_jira.rake Magnifier (11.6 KB) Charles L, 2008-06-05 10:24

migrate_from_jira.rake.patch Magnifier - A patch against the original rake task (3.5 KB) Marcel Waldvogel, 2010-02-01 23:04

migrate_from_jira.rake Magnifier - The complete rake task for those who just need something to work (11.6 KB) Marcel Waldvogel, 2010-02-01 23:04

migrate_from_jira.rake Magnifier (11.7 KB) Nikolay Artemenko, 2010-05-21 09:02

migrate_from_jira.rake Magnifier - Updated to create Trackers / Resolutions etc.. if they did not exist (13.1 KB) Kevin Marvin, 2010-09-03 23:18

migrate_from_jira.rake Magnifier (13.2 KB) Tom Rochette, 2011-06-04 19:09

migrate_jira.rake Magnifier - alternate script (19.2 KB) Luciano Pacheco, 2011-06-07 06:28

migrate_jira.rake Magnifier (18.1 KB) Rudy Attias, 2012-06-13 15:12

History

#1 Updated by Thomas Lecavelier about 9 years ago

A big thanks to you. Could you provide a Jira db dump in order to try the script (and eventually improve it)? Thank you

#2 Updated by Vasudeva Server over 8 years ago

I am trying to import a small JIRA XML export, but I get an error (and, I am a newbie).

1) I copied your script to my install, in redmine/lib/tasks
2) I copied the JIRA DB export file, called jira.xml, in the main redmine directory (/home/vsm/public_html/redmine/)
3) I invoke the script with: rake redmine:migrate_from_jira RAILS_ENV="test"

This is what I get:

"WARNING: a new project will be added to Redmine during this process.
Are you sure you want to continue ? [y/N]"

y

Then I get:
"Jira issue xml file [SearchRequest.xml]: "

/home/vsm/public_html/redmine/jira.xml

It requests:
"Target project identifier []:"

SYS

And it prints the error message:
"Unable to create a project with identifier 'WS'!"

Could you please tell me what am I doing wrong?

Thank you!

Priyadarshan

#3 Updated by Charles L over 8 years ago

I'm not really sure how if you type in SYS (which gets stored in the variable identifier), that it somehow ends up as WS in the error message? Maybe try creating a project with that identifier before hand, so it shouldn't be doing anything more than project = Project.find_by_identifier('SYS').

#4 Updated by Henrik A over 8 years ago

Hi. I created an XML backup from Jira 3.12.1 (Administration » Import & Export » Backup Data to XML) and tried importing it to Redmine using by Vasudeva's instructions above.

I had to create a project in Redmine first, but after working a while the import ended up with "Projects: 0/0, Components: 0/0, Issues: 0/0". My Jira had several projects and thousands of issues.

#5 Updated by Charles L over 8 years ago

Hi Henrik,

When I did the migration, similar to the mentioned jira2trac.rb script, I based it off the rss feed. I wasn't aware of the Backup data to xml function, likely as no-one in our team had admin access.

I ended up with an file called SearchRequest.xml, and the contents looked roughly like (heavily edited to protect the innocent) the below. If you set up the search to cover everything, it will have all issues from all relevant projects, full comment history, most fields etc.

<?xml version="1.0"?>
<!--  RSS generated by JIRA (Enterprise Edition, Version: 3.10.2-#262) at Mon Mar 10 12:25:18 SGT 2008 -->
<rss version="0.92">
  <channel>
    <title>BLAH BLAH ORGANISATION</title>
    <link>http://10.203.1.49:6080/secure/IssueNavigator.jspa?BLAHBLAH</link>
    <description>An XML representation of a search request</description>
    <language>en-au</language>
    <item>
      <title>[QRST-32] Crash when blah blah</title>
      <link>http://10.203.1.49:6080/browse/QRST-32</link>
      <description>
Unhandled Exception: System.IO.IOException: Unable to read data from the transpo&lt;br/&gt;
rt connection: An existing connection was forcibly closed by the remote host. --
      </description>
      <environment/>
      <key id="27482">QRST-32</key>
      <summary>Crash when blah blah</summary>
      <type id="1" iconUrl="http://10.203.1.49:6080/images/icons/bug_red.gif">Bug</type>
      <priority id="3" iconUrl="http://10.203.1.49:6080/images/icons/warning.gif">High</priority>
      <status id="1" iconUrl="http://10.203.1.49:6080/images/icons/status_open.gif">Open</status>
      <resolution id="-1">Unresolved</resolution>
      <assignee username="blah">Mr Blah</assignee>
      <reporter username="blah">Mr Blah</reporter>
      <created>Thu, 6 Mar 2008 14:23:00 +0800 (SGT)</created>
      <updated>Thu, 6 Mar 2008 14:23:00 +0800 (SGT)</updated>
      <component>Blah component</component>
      <due/>
      <attachments>
      </attachments>
      <subtasks>
      </subtasks>
      <customfields>
        <customfield id="customfield_10423" key="com.atlassian.jira.plugin.system.customfieldtypes:float">
          <customfieldname>Estimated Effort (Hrs)</customfieldname>
          <customfieldvalues>
            <customfieldvalue>0.0</customfieldvalue>
          </customfieldvalues>
        </customfield>
      </customfields>
    </item>
  </channel>
</rss>

#6 Updated by Marcel Waldvogel over 7 years ago

We had to migrate some Jira issues into 0.9rc and found out that the script needs adaptation to the current data model. This has been done below. I also changed the way how issue status and trackers are determined. Previously, it expected them to be at a particular position in the sort order, now it expects them to have a certain name. Even though this opens up issues with the language barrier (my native language is not English, so don't complain too loud about my cultural ignorance).

You need to make sure to have issue status values called "Assigned", "Resolved", and "Feedback" as well as trackers called "Bug", "Feature", and "Task" (or change the lines with IssueStatus.find_by_name and Tracker.find_by_name).

UltraShort HowTo:
  1. Create an XML issue dump (not a backup!) of your Jira tasks
  2. Put the .rake file in …/redmine/lib/tasks
  3. run rake redmine:migrate_from_jira RAILS_ENV=production and answer the questions

Happy migrations!

#7 Updated by Marcel Waldvogel over 7 years ago

BTW: What would be needed to get this script into the main distribution?

#8 Updated by Benoît Capitanio over 7 years ago

Hi guys.

Maybe I missed something but when I try to import a Jira XML files to redmine. I've got this error :

root@sysnet:/data/web/redmine# RAILS_ENV=production rake redmine:migrate_from_jira --trace
(in /data/web/redmine)
rake aborted!
/data/web/redmine/lib/tasks/migrate_from_jira.rake:1: syntax error, unexpected '<'
<!DOCTYPE html PUBLIC "-//W3C/...
^
/data/web/redmine/lib/tasks/migrate_from_jira.rake:2: syntax error, unexpected '<'
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
^
/data/web/redmine/lib/tasks/migrate_from_jira.rake:2: syntax error, unexpected tIDENTIFIER, expecting $end
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
^
/data/web/redmine/vendor/rails/activesupport/lib/active_support/dependencies.rb:145:in `load'
/data/web/redmine/vendor/rails/activesupport/lib/active_support/dependencies.rb:145:in `block in load_with_new_constant_marking'
/data/web/redmine/vendor/rails/activesupport/lib/active_support/dependencies.rb:521:in `new_constants_in'
/data/web/redmine/vendor/rails/activesupport/lib/active_support/dependencies.rb:145:in `load_with_new_constant_marking'
/data/web/redmine/vendor/rails/railties/lib/tasks/rails.rb:9:in `block in <top (required)>'
/data/web/redmine/vendor/rails/railties/lib/tasks/rails.rb:9:in `each'
/data/web/redmine/vendor/rails/railties/lib/tasks/rails.rb:9:in `<top (required)>'
/data/web/redmine/Rakefile:10:in `require'
/data/web/redmine/Rakefile:10:in `<top (required)>'
/opt/ruby/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2383:in `load'
/opt/ruby/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2383:in `raw_load_rakefile'
/opt/ruby/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2017:in `block in load_rakefile'
/opt/ruby/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/opt/ruby/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2016:in `load_rakefile'
/opt/ruby/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2000:in `block in run'
/opt/ruby/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/opt/ruby/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
/opt/ruby/lib/ruby/gems/1.9.1/gems/rake-0.8.7/bin/rake:31:in `<top (required)>'
/opt/ruby/bin/rake:19:in `load'
/opt/ruby/bin/rake:19:in `<main>'

Did someone has got the same error?

Thanks.

Benoît

#9 Updated by Charles L over 7 years ago

That looks like you're trying to run html as ruby. You need to click on the attachment links, and then you can download from that page, otherwise you get the formatted version.

#10 Updated by Benoît Capitanio over 7 years ago

Charles L wrote:

That looks like you're trying to run html as ruby. You need to click on the attachment links, and then you can download from that page, otherwise you get the formatted version.

Thanks Charles it's better but i still got errors... :

root@sysnet:/data/web/redmine# RAILS_ENV=production rake redmine:migrate_from_jira --trace
(in /data/web/redmine)
** Invoke redmine:migrate_from_jira (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute redmine:migrate_from_jira
rake aborted!
undefined method `get_values' for #<Class:0x00000005294ff8>
/data/web/redmine/vendor/rails/activerecord/lib/active_record/base.rb:1959:in `method_missing'
/data/web/redmine/lib/tasks/migrate_from_jira.rake:28:in `<module:JiraMigrate>'
/data/web/redmine/lib/tasks/migrate_from_jira.rake:27:in `block (2 levels) in <top (required)>'
/opt/ruby/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:636:in `call'
/opt/ruby/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:636:in `block in execute'
/opt/ruby/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:631:in `each'
/opt/ruby/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
/opt/ruby/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:597:in `block in invoke_with_call_chain'
/opt/ruby/lib/ruby/1.9.1/monitor.rb:190:in `mon_synchronize'
/opt/ruby/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
/opt/ruby/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
/opt/ruby/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'
/opt/ruby/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2029:in `block (2 levels) in top_level'
/opt/ruby/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
/opt/ruby/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2029:in `block in top_level'
/opt/ruby/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/opt/ruby/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'
/opt/ruby/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2001:in `block in run'
/opt/ruby/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/opt/ruby/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
/opt/ruby/lib/ruby/gems/1.9.1/gems/rake-0.8.7/bin/rake:31:in `<top (required)>'
/opt/ruby/bin/rake:19:in `load'
/opt/ruby/bin/rake:19:in `<main>'

Thanks.

Benoît Capitanio

#11 Updated by Charles L over 7 years ago

There have been changes to Redmine's data model since the script was first written over a year ago. Marcel fixed it to work again recently - you should download his newer version (see attachments section) or equivalently apply his patch.

#12 Updated by Benoît Capitanio over 7 years ago

Charles L wrote:

There have been changes to Redmine's data model since the script was first written over a year ago. Marcel fixed it to work again recently - you should download his newer version (see attachments section) or equivalently apply his patch.

Thanks Charles.
I tried the Marcel's script but I've got the same errors.
Now I try to migrate from the script Jira2Trac.

Benoît

#13 Updated by Charles L over 7 years ago

Yes, it seems Marcel's script is identical to mine somehow (perhaps the attachments system got confused by them having the same filename on the same issue?). You'd need to apply the patch to get the updated version.

#14 Updated by V.M. Kattenberg over 7 years ago

I just tried the script to import an XML issue dump into our Redmine installation. I downloaded the original script from Charles L and applied the Marcel's patch: The first error I encountered was the REXML/document class not being imported, I fixed this by adding the line require 'rexml/document' at the start of the script - now I have gotten a little bit further with my import but it still stops with the following error:

Mysql::Error: Duplicate entry '15-1' for key 'projects_trackers_unique': INSERT INTO `projects_trackers` (`project_id`, `tracker_id`) VALUES (15, 1)

I am at a loss here.

#15 Updated by Charles L over 7 years ago

It originally assumed it was going to be importing the issues into a new project, and that it wouldn't have the necessary trackers. If you're using a pre-existing project, or if the default trackers have changed, just comment out the lines where it unconditionally adds the trackers to the project (project.trackers << TRACKER_BLAH).

#16 Updated by Yuriz DeHaupt about 7 years ago

On my system it appears to have a NilClass issue.
Maybe my debian packaged ruby version is too old? ruby 1.8.7 (2008-08-11 patchlevel 72) [i486-linux]

rake --trace redmine:migrate_from_jira
(in /usr/share/redmine)
  • Invoke redmine:migrate_from_jira (first_time)
  • Invoke environment (first_time)
  • Execute environment
  • Execute redmine:migrate_from_jira

WARNING: a new project will be added to Redmine during this process.
Are you sure you want to continue ? [y/N] y

Jira issue xml file [SearchRequest.xml]:
Target project identifier []: imported

Migrating projects.rake aborted!
undefined method `downcase' for nil:NilClass
/usr/share/redmine/lib/tasks/migrate_from_jira.rake:173:in `migrate'
/usr/share/redmine/lib/tasks/migrate_from_jira.rake:170:in `each'
/usr/share/redmine/lib/tasks/migrate_from_jira.rake:170:in `migrate'
/usr/share/redmine/lib/tasks/migrate_from_jira.rake:161:in `open'
/usr/share/redmine/lib/tasks/migrate_from_jira.rake:161:in `migrate'
/usr/share/redmine/lib/tasks/migrate_from_jira.rake:345
/usr/lib/ruby/1.8/rake.rb:636:in `call'
/usr/lib/ruby/1.8/rake.rb:636:in `execute'
/usr/lib/ruby/1.8/rake.rb:631:in `each'
/usr/lib/ruby/1.8/rake.rb:631:in `execute'
/usr/lib/ruby/1.8/rake.rb:597:in `invoke_with_call_chain'
/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/usr/lib/ruby/1.8/rake.rb:590:in `invoke_with_call_chain'
/usr/lib/ruby/1.8/rake.rb:583:in `invoke'
/usr/lib/ruby/1.8/rake.rb:2051:in `invoke_task'
/usr/lib/ruby/1.8/rake.rb:2029:in `top_level'
/usr/lib/ruby/1.8/rake.rb:2029:in `each'
/usr/lib/ruby/1.8/rake.rb:2029:in `top_level'
/usr/lib/ruby/1.8/rake.rb:2068:in `standard_exception_handling'
/usr/lib/ruby/1.8/rake.rb:2023:in `top_level'
/usr/lib/ruby/1.8/rake.rb:2001:in `run'
/usr/lib/ruby/1.8/rake.rb:2068:in `standard_exception_handling'
/usr/lib/ruby/1.8/rake.rb:1998:in `run'
/usr/bin/rake:28

#17 Updated by Nikolay Artemenko about 7 years ago

Marcel Waldvogel wrote:

We had to migrate some Jira issues into 0.9rc and found out that the script needs adaptation to the current data model. This has been done below. I also changed the way how issue status and trackers are determined. Previously, it expected them to be at a particular position in the sort order, now it expects them to have a certain name. Even though this opens up issues with the language barrier (my native language is not English, so don't complain too loud about my cultural ignorance).

You need to make sure to have issue status values called "Assigned", "Resolved", and "Feedback" as well as trackers called "Bug", "Feature", and "Task" (or change the lines with IssueStatus.find_by_name and Tracker.find_by_name).

UltraShort HowTo:
  1. Create an XML issue dump (not a backup!) of your Jira tasks
  2. Put the .rake file in …/redmine/lib/tasks
  3. run rake redmine:migrate_from_jira RAILS_ENV=production and answer the questions

Happy migrations!

Hi! In UltraShort HowTo were written "Create an XML issue dump (not a backup!) of your Jira tasks". So, can somebody explain me more closely how to do this?

Thanks

#18 Updated by Charles L about 7 years ago

I no longer even have Jira, so I can't easily check. I think it took the same input as jira2trace.rb (http://trac.edgewall.org/attachment/wiki/TracImport/jira2trac.rb), which is a dump from the RSS feed - see comment #5.

#19 Updated by Nikolay Artemenko about 7 years ago

Thanks Charles L. Now, when i run migrate_from_jira.rake i have error message:

rake aborted!
undefined method 'get_values' for #<Class:0xb769eae4>

What`s the matter?

#20 Updated by Nikolay Artemenko about 7 years ago

Sorry. Were careless.

But have new problem.

After 10 second working script i recieved new error message...

Migrating projects.rake aborted!
Tracker(#-609467598) expected, got NicClass(#-604479008)

#21 Updated by Charles L about 7 years ago

Have you updated the script with Marcel's patch? Also you probably want to run the rake command with --trace, to find out what line is causing the problem. Most likely is that you don't have trackers called Bug, Feature, and Task (see top of the script), which are used in the TRACKER_MAPPING to convert from the jira issue type. So it fails validation on save. Did you run the default redmine schema load?

#22 Updated by Nikolay Artemenko about 7 years ago

The problem was, that if Jira ticket have unassigned "assignee to" field this script is broken down. This problem has been resolved and in a few days i`ll put there .patch file.

The next problem came up, that this script not migrate jira milestones and customfields to redmine versions and customfields respectively.
Does anybody know how to solve it?
Will thankful for any help...

#23 Updated by jamon camisso about 7 years ago

Hi Nikolay, having the same problem that you described. Would you mind posting your patch or just the complete migrate_from_jira script? So close to being free from Jira but I lack ruby/rails knowledge to be able to fix the migration script on my own.

Tracker(#70060922005220) expected, got NilClass(#70060960471960)

#24 Updated by Nikolay Artemenko about 7 years ago

Jamon, try to run this patched script.
It works, but it`s not final version.
In the begining of june i`ll try to post there migration script, that will migrate as well milestones and custom fields.

#25 Updated by Philip Hunt almost 7 years ago

Nikolay, I've tried running your script (using Redmine 0.9.4) - but receive the following error:

rake redmine:migrate_from_jira RAILS_ENV=production --trace
(in /opt/redmine-0.9.4)
** Invoke redmine:migrate_from_jira (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute redmine:migrate_from_jira

WARNING: a new project will be added to Redmine during this process.
Are you sure you want to continue ? [y/N] y

Jira issue xml file [SearchRequest.xml]: /opt/jira_backup/jira_20100706.xml
Target project identifier []: jira

rake aborted!
uninitialized constant REXML::Document
/opt/redmine-0.9.4/vendor/rails/activesupport/lib/active_support/dependencies.rb:443:in `load_missing_constant'
/opt/redmine-0.9.4/vendor/rails/activesupport/lib/active_support/dependencies.rb:80:in `const_missing'
/opt/redmine-0.9.4/lib/tasks/migrate_from_jira.rake:166:in `migrate'
/opt/redmine-0.9.4/lib/tasks/migrate_from_jira.rake:165:in `open'
/opt/redmine-0.9.4/lib/tasks/migrate_from_jira.rake:165:in `migrate'
/opt/redmine-0.9.4/lib/tasks/migrate_from_jira.rake:350
/usr/lib/ruby/1.8/rake.rb:617:in `call'
/usr/lib/ruby/1.8/rake.rb:617:in `execute'
/usr/lib/ruby/1.8/rake.rb:612:in `each'
/usr/lib/ruby/1.8/rake.rb:612:in `execute'
/usr/lib/ruby/1.8/rake.rb:578:in `invoke_with_call_chain'
/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/usr/lib/ruby/1.8/rake.rb:571:in `invoke_with_call_chain'
/usr/lib/ruby/1.8/rake.rb:564:in `invoke'
/usr/lib/ruby/1.8/rake.rb:2027:in `invoke_task'
/usr/lib/ruby/1.8/rake.rb:2005:in `top_level'
/usr/lib/ruby/1.8/rake.rb:2005:in `each'
/usr/lib/ruby/1.8/rake.rb:2005:in `top_level'
/usr/lib/ruby/1.8/rake.rb:2044:in `standard_exception_handling'
/usr/lib/ruby/1.8/rake.rb:1999:in `top_level'
/usr/lib/ruby/1.8/rake.rb:1977:in `run'
/usr/lib/ruby/1.8/rake.rb:2044:in `standard_exception_handling'
/usr/lib/ruby/1.8/rake.rb:1974:in `run'
/usr/bin/rake:28

#26 Updated by Terence Mill almost 7 years ago

Hi!
I tried to migrate and got this abort message: Unable to create a sub project
Plz help!

---------------------------
sid-repo:/redmine# dir
\ config doc files lib public README.rdoc test vendor
app db extra jira.xml log Rakefile script tmp
sid-repo:/redmine# rake redmine:migrate_from_jira RAILS_ENV="production"
(in /usr/local/lib/redmine-0.9)

WARNING: a new project will be added to Redmine during this process.
Are you sure you want to continue ? [y/N] y

Jira issue xml file [SearchRequest.xml]: jira.xml
Target project identifier []: import

Migrating projects.Unable to create a sub project with identifier '08049'!
rake aborted!
You cannot move a new node
/usr/local/lib/redmine-0.9/vendor/plugins/awesome_nested_set/lib/awesome_nested_ set.rb:476:in `move_to'
/usr/local/lib/redmine-0.9/vendor/plugins/awesome_nested_set/lib/awesome_nested_ set.rb:396:in `move_to_child_of'
/usr/local/lib/redmine-0.9/lib/tasks/migrate_from_jira.rake:185:in `migrate'
/usr/local/lib/redmine-0.9/lib/tasks/migrate_from_jira.rake:174:in `each'
/usr/local/lib/redmine-0.9/lib/tasks/migrate_from_jira.rake:174:in `migrate'
/usr/local/lib/redmine-0.9/lib/tasks/migrate_from_jira.rake:165:in `open'
/usr/local/lib/redmine-0.9/lib/tasks/migrate_from_jira.rake:165:in `migrate'
/usr/local/lib/redmine-0.9/lib/tasks/migrate_from_jira.rake:350
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `call'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `execute'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `each'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in `invoke_with_cal l_chain'
/usr/local/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_cal l_chain'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_excep tion_handling'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in `run'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_excep tion_handling'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31
/usr/local/bin/rake:19:in `load'
/usr/local/bin/rake:19
sid-repo:/redmine#

#27 Updated by Philip Hunt almost 7 years ago

Hi, I've made good progress with the Jira import script, but - I now have an error which has me stumped:
"Validation failed: Tracker is not included in the list" (see trace below)

This problem happens when the "i.save!" method is called from the rake task, when adding issues to Redmine.

Could anyone please suggest how to resolve this problem so I can continue with my Jira migration?

Many thanks,
Phil

rake redmine:migrate_from_jira RAILS_ENV=production --trace
(in /opt/redmine-0.9.4)
** Invoke redmine:migrate_from_jira (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute redmine:migrate_from_jira

WARNING: a new project will be added to Redmine during this process.
Are you sure you want to continue ? [y/N] y

Jira issue xml file [SearchRequest.xml]: /home/ubuntu/jira_rss2.xml
Target project identifier []: jira

Migrating projects.
Migrating components.....
Migrating issues .rake aborted!
Validation failed: Tracker is not included in the list
/opt/redmine-0.9.4/vendor/rails/activerecord/lib/active_record/validations.rb:1090:in `save_without_dirty!'
/opt/redmine-0.9.4/vendor/rails/activerecord/lib/active_record/dirty.rb:87:in `save_without_transactions!'
/opt/redmine-0.9.4/vendor/rails/activerecord/lib/active_record/transactions.rb:200:in `save!'
/opt/redmine-0.9.4/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:136:in `transaction'
/opt/redmine-0.9.4/vendor/rails/activerecord/lib/active_record/transactions.rb:182:in `transaction'
/opt/redmine-0.9.4/vendor/rails/activerecord/lib/active_record/transactions.rb:200:in `save!'
/opt/redmine-0.9.4/vendor/rails/activerecord/lib/active_record/transactions.rb:208:in `rollback_active_record_state!'
/opt/redmine-0.9.4/vendor/rails/activerecord/lib/active_record/transactions.rb:200:in `save!'
/opt/redmine-0.9.4/lib/tasks/migrate_from_jira.rake:248:in `migrate'
/opt/redmine-0.9.4/lib/tasks/migrate_from_jira.rake:226:in `each'
/opt/redmine-0.9.4/lib/tasks/migrate_from_jira.rake:226:in `migrate'
/opt/redmine-0.9.4/vendor/rails/activesupport/lib/active_support/ordered_hash.rb:97:in `each'
/opt/redmine-0.9.4/vendor/rails/activesupport/lib/active_support/ordered_hash.rb:97:in `each'
/opt/redmine-0.9.4/lib/tasks/migrate_from_jira.rake:224:in `migrate'
/opt/redmine-0.9.4/lib/tasks/migrate_from_jira.rake:165:in `open'
/opt/redmine-0.9.4/lib/tasks/migrate_from_jira.rake:165:in `migrate'
/opt/redmine-0.9.4/lib/tasks/migrate_from_jira.rake:351
/usr/lib/ruby/1.8/rake.rb:617:in `call'
/usr/lib/ruby/1.8/rake.rb:617:in `execute'
/usr/lib/ruby/1.8/rake.rb:612:in `each'
/usr/lib/ruby/1.8/rake.rb:612:in `execute'
/usr/lib/ruby/1.8/rake.rb:578:in `invoke_with_call_chain'
/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/usr/lib/ruby/1.8/rake.rb:571:in `invoke_with_call_chain'
/usr/lib/ruby/1.8/rake.rb:564:in `invoke'
/usr/lib/ruby/1.8/rake.rb:2027:in `invoke_task'
/usr/lib/ruby/1.8/rake.rb:2005:in `top_level'
/usr/lib/ruby/1.8/rake.rb:2005:in `each'
/usr/lib/ruby/1.8/rake.rb:2005:in `top_level'
/usr/lib/ruby/1.8/rake.rb:2044:in `standard_exception_handling'
/usr/lib/ruby/1.8/rake.rb:1999:in `top_level'
/usr/lib/ruby/1.8/rake.rb:1977:in `run'
/usr/lib/ruby/1.8/rake.rb:2044:in `standard_exception_handling'
/usr/lib/ruby/1.8/rake.rb:1974:in `run'
/usr/bin/rake:28

#28 Updated by Bram Bouwens almost 7 years ago

I also tried to use this script, but I fell into the obvious trap of trying it on a Jira DB export,
so indeed, nothing got loaded.
So I need to "Create an XML issue dump (not a backup!) of my Jira tasks" which is the same as a
Jira RSS feed. Would that be what I get when clicking on the RSS button on the dashboard? That is like

<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:usr="http://streams.atlassian.com/syndication/username/1.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:thr="http://purl.org/syndication/thread/1.0">
  <title>ProjectName JIRA - Activity Stream</title>
  <id>https://www.example.com:8443</id>
  <updated>2010-07-31T20:47:06Z</updated>
  <dc:date>2010-07-31T20:47:06Z</dc:date>
  <entry>
    <title type="html">&lt;a href='https://www.example.com:8443/secure/ViewProfile.jspa?name=jimmy'&gt;Jimmy Neutron&lt;/a&gt; updated the Description of &lt;a href="https://www.example.com:8443/browse/PN-9"&gt;PN-9&lt;/a&gt; (Properly implement Dolph-Chebyshev window)</title>
    <link rel="alternate" href="https://www.example.com:8443/browse/PN-9" />
    <link rel="http://streams.atlassian.com/syndication/icon" href="https://www.example.com:8443/images/icons/task.gif" />
    <link rel="http://streams.atlassian.com/syndication/reply-to" href="https://www.example.com:8443/plugins/servlet/streamscomments/PN-9" />
    <author>
      <name>Jimmy Neutron</name>
      <uri>https://www.example.com:8443/secure/ViewProfile.jspa?name=jimmy</uri>
      <email>jimmy@example.com</email>
      <usr:username>jimmy</usr:username>
    </author>

etc. which isn't exactly like mentioned above ... ?

#29 Updated by Bram Bouwens almost 7 years ago

Ah ... seems I got it. The secret is to go to the Issue Navigator and view all, and then
use the "Views" on top of the list? This gave me a file somewhat similar to the one above.

But then:

Jira issue xml file [SearchRequest.xml]: 
Target project identifier []: jira
Unable to create a project with identifier 'jira'!
Target project identifier []: import

Migrating projects.rake aborted!
Mysql::Error: Duplicate entry '3-1' for key 'projects_trackers_unique': INSERT INTO `projects_trackers` (`project_id`, `tracker_id`) VALUES (3, 1)

(See full trace by running task with --trace)

This brings me to the question: what is the "Target project identifier" supposed to be?
I would think that it should match the name of the project to be imported, but lots of names
I tried are rejected with the "Unable to create a project with identifier 'foo'" message.

And on a previous try I got:

Jira issue xml file [SearchRequest.xml]: 
Target project identifier []: import

Migrating projects.rake aborted!
Tracker(#-613562478) expected, got NilClass(#-608040488)

.. so it accepted "import" at that time but then got a NilClass.
Is that because some ticket are unassigned, still?

Maybe I have already messed up the database (in mysql BTW).
Should I clean it before trying again?

#30 Updated by jamon camisso almost 7 years ago

Hi all, as an update, I've been running into errors like the ones described in many comments. I've managed to figure out that importing into a clean install of Redmine doesn't work, even if Bug/Issue etc. trackers are enabled.

However, I have a populated instance of Redmine that has been upgraded from 0.8.x to 1.0 that I can import into, so I'm going to try figuring out what about that particular instance is different from a clean install and post back here.

#31 Updated by jamon camisso almost 7 years ago

Yet another update, I have the import working with a new postgresql backed redmine.

Make sure that you have a custom "Resolution" field defined as a list, with "fixed invalid wontfix duplicate worksforme" values.

You will also need a Task and Deliverable tracker with defined workflows. From there run the import script and you should be all set.

#32 Updated by Kevin Marvin almost 7 years ago

I've done some modifications to this script as well, and have attached it. I ran into some trouble doing a migration from a big Jira install to a brand new Redmine, and added find_or_create for most of the things that Redmine requires. Much easier, IMO, to modify after created than pre-create.

Anyway, this worked beautifully with all of our bugs in migration.

#33 Updated by Tiklu Ganguly over 6 years ago

Hi I am also having a similar problem to this one. I am using redmine 1.0.x in windows. Please help
Philip Hunt wrote:

Nikolay, I've tried running your script (using Redmine 0.9.4) - but receive the following error:

[...]

#34 Updated by Todd Osborne about 6 years ago

I have Redmine 1.1.2 installed (Bitnami version) on a MacOS X and ran the latest import script. Everything seemed to go fine but after it completed, it didn't really import anything except create a new project in Redmine (JIRA Import). Any ideas?

mac_dt100117:tasks tosborne$ sudo rake redmine:migrate_from_jira RAILS_ENV=production
(in /Applications/redmine-1.1.2-1/apps/redmine)

WARNING: a new project will be added to Redmine during this process.
Are you sure you want to continue ? [y/N] y

Jira issue xml file [SearchRequest.xml]: /Users/tosborne/redmine.xml
Target project identifier []: 
Unable to create a project with identifier ''!
Target project identifier []: jira

loading file
items enumerated
Migrating projects
Migrating components
Migrating issues 

Projects:        0/0
Components:      0/0
Issues:          0/0

#35 Updated by Todd Osborne about 6 years ago

Disregard, I missed the part that you need to use the RSS feed (Search) feature and not the Backup feature in JIRA.

#36 Updated by Ahmed Mseddi about 6 years ago

Hi all

I am using Redmine 1.1.2 and when trying to import xml dump from Jira, the following error occurs :

loading file
items enumerated
Migrating projects.rake aborted!
Mysql::Error: Duplicate entry '3-4' for key 'projects_trackers_unique': INSERT INTO `projects_trackers` (`project_id`, `tracker_id`) VALUES (3, 4)

So as suggested, I commented the lines project.trackers << TRACKER_xxx. The import was successful but all issues had bug Tracker and open Status.

Moreover the unassigned issues were assigned to user Unassigned unassigned () and the import stopped after importing 1000 issues (my XML contains 4040 issues).

Did someone has encountered this issues ? Do you have any ideas on how to fix them ?

Thanks.

#37 Updated by Tom Rochette about 6 years ago

I had the problem previously mentionned where it would try to insert into project_trackers_unique already existing trackers. Here is a fix to Kevin Marvin, 2010-09-03 17:18 .rake file.

#38 Updated by Luciano Pacheco about 6 years ago

I did a new script to migrate from Jira to Redmine, of course it's based on the original one.

This script migrates Issue Types, Issue Status, Issue Priorities (this 3 can be configured), Users, Projects, Issues and Comments. Also tried migrate the Attachments, but I don't have access to the files, so I can't really test this.

The Users migrations is the most slowly, so if you have a lot of Users in Jira you'll take a long time, if you have like 10-20 users will take just 2 minutes.

The script is based the full backup xml Jira file, that need to be called backup_jira.xml (or you need to change the name in the script sources).

The first time you run the script it will generate a yaml file so you can configure 3 migrations options:
Issues Priorities, Issues Types and Issue Status, because you can choose to integrates some options together or just create the same options on Redmine, you need to change this. I put some default values to Jira defaults.

If you want to customise the migration, all the trick is done in class Methods (red_* and jira_*). When you call a jira_* the class will try to get the value from a xml tag attribute or from a children tag.

The red_* is the name of the fields on Redmine.

Others 2 methods that can be used is before_save, that is called before save the Redmine model, so you can settup new values in the models fields, before save it. And the post_migrate methods, because sometimes you need the model saved to do somethings.

I'm not a experienced rubyst, yet, so it's the code that I could produced. :-)

I have a problem when running this script on production, with a require 'config/environment', that I need to change to do a relative, something like that: " File.expand_path('../../config/boot', __FILE__) ". But in my development enviroment, is exactly this script. :-/

#39 Updated by Anjani Kumar about 6 years ago

Tom Rochette wrote:

I had the problem previously mentionned where it would try to insert into project_trackers_unique already existing trackers. Here is a fix to Kevin Marvin, 2010-09-03 17:18 .rake file.

Hello Tom, I am using latest rake provided by you you but stuck on mentioned error.

Jira issue xml file [SearchRequest.xml]: /var/www/redmine/lib/tasks/rss_backup_jira.xml
Target project identifier []: Jira
Unable to create a project with identifier 'Jira'!
Target project identifier []: jira

loading file
items enumerated
Migrating projects....
Migrating components
Migrating issues .rake aborted!
Validation failed: Author can't be blank
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/validations.rb:1102:in `save_without_dirty!'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/dirty.rb:87:in `save_without_transactions!'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/transactions.rb:200:in `save!'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/connection_adapters/abstract/database_statements.rb:136:in `transaction'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/transactions.rb:182:in `transaction'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/transactions.rb:200:in `save!'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/transactions.rb:208:in `rollback_active_record_state!'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/transactions.rb:200:in `save!'
/var/www/redmine/lib/tasks/migrate_from_jira.rake:274:in `migrate'
/var/www/redmine/lib/tasks/migrate_from_jira.rake:245:in `each'
/var/www/redmine/lib/tasks/migrate_from_jira.rake:245:in `migrate'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.11/lib/active_support/ordered_hash.rb:115:in `each'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.11/lib/active_support/ordered_hash.rb:115:in `each'
/var/www/redmine/lib/tasks/migrate_from_jira.rake:243:in `migrate'
/var/www/redmine/lib/tasks/migrate_from_jira.rake:182:in `open'
/var/www/redmine/lib/tasks/migrate_from_jira.rake:182:in `migrate'
/var/www/redmine/lib/tasks/migrate_from_jira.rake:384
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:205:in `call'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:205:in `execute'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:200:in `each'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:200:in `execute'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:158:in `invoke_with_call_chain'
/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:144:in `invoke'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:112:in `invoke_task'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:90:in `top_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:90:in `each'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:90:in `top_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:84:in `top_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:62:in `run'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:59:in `run'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/bin/rake:32
/usr/bin/rake:19:in `load'
/usr/bin/rake:19
Tasks: TOP => redmine:migrate_from_jira

I am in urgent need for transitioning to redmine as jira license is about to expire soon.Regards!

#40 Updated by Roman Vishnevsky almost 6 years ago

Ahmed Mseddi wrote:

Moreover the unassigned issues were assigned to user Unassigned unassigned () and the import stopped after importing 1000 issues (my XML contains 4040 issues).

Did someone has encountered this issues ? Do you have any ideas on how to fix them ?

Thanks.

Hi, You url after chose XML in issues like this:
http://myjira.domain.org/sr/jira.issueviews:searchrequest-xml/temp/SearchRequest.xml?jqlQuery=project+%3D+GJ&tempMax=1000

set by hand in url tempMax=10000

#41 Updated by Carlos Scaloni almost 6 years ago

I can't do the migration... I have this error all the time:

redmine:/usr/local/lib/redmine-1.2# rake RAILS_ENV="production" db:migrate_jira --trace
(in /usr/local/lib/redmine-1.2)
rake aborted!
Don't know how to build task 'db:migrate_jira'
/usr/lib/ruby/1.8/rake.rb:1728:in `[]'
/usr/lib/ruby/1.8/rake.rb:2050:in `invoke_task'
/usr/lib/ruby/1.8/rake.rb:2029:in `top_level'
/usr/lib/ruby/1.8/rake.rb:2029:in `each'
/usr/lib/ruby/1.8/rake.rb:2029:in `top_level'
/usr/lib/ruby/1.8/rake.rb:2068:in `standard_exception_handling'
/usr/lib/ruby/1.8/rake.rb:2023:in `top_level'
/usr/lib/ruby/1.8/rake.rb:2001:in `run'
/usr/lib/ruby/1.8/rake.rb:2068:in `standard_exception_handling'
/usr/lib/ruby/1.8/rake.rb:1998:in `run'
/usr/bin/rake:28

Can someone help me, please?

#42 Updated by Carlos Scaloni almost 6 years ago

If I type "rake -T" I can see this:

rake jira_migration:do_all_migrations # Tests all parsers!
rake jira_migration:generate_conf # Generates the configuration for the map things from Jira to Redmine
rake jira_migration:migrate_attachments # Migrates Jira Issues Attachments to Redmine Attachments
rake jira_migration:migrate_comments # Migrates Jira Issues Comments to Redmine Issues Journals (Notes)
rake jira_migration:migrate_issue_priorities # Migrates Jira Issue Priorities to Redmine Priorities
rake jira_migration:migrate_issue_status # Migrates Jira Issue Status to Redmine Status
rake jira_migration:migrate_issue_types # Migrates Jira Issue Types to Redmine Trackes
rake jira_migration:migrate_issues # Migrates Jira Issues to Redmine Issues
rake jira_migration:migrate_projects # Migrates Jira Projects to Redmine Projects
rake jira_migration:migrate_users # Migrates Jira Users to Redmine Users
rake jira_migration:pre_conf # Gets the configuration from YAML
rake jira_migration:test_all_migrations # Tests all parsers!
rake jira_migration:test_parse_comments # Just pretty print Jira Comments on screen
rake jira_migration:test_parse_issues # Just pretty print Jira Issues on screen
rake jira_migration:test_parse_projects # Just pretty print Jira Projects on screen
rake jira_migration:test_parse_users # Just pretty print Jira Users on screen

#43 Updated by Carlos Scaloni almost 6 years ago

I answer my question... It works great!! 100%

My HoWTo:

1. Go to Jira Administration -> Import & Export -> Backup Data to XML (*) * It's possible you have to configure a Backup Dir In the file:
/usr/local/jira/atlassian-jira-enterprise-4.1.2-standalone/atlassian-jira/WEB-INF/classes/jira-application.properties
For example adding this line: jira.paths.safe.backup.path=/tmp

2. Save the backup with the name: backup_jira.xml

3. Put this file in the main dir of redmine. In my case: /usr/local/lib/redmine-1.2

4. Download the script "migrate_jira.rake" developed by Luciano Pacheco: http://www.redmine.org/attachments/download/6106/migrate_jira.rake

5. Put the script in the [redmine dir]/lib/tasks/. In my case: /usr/local/lib/redmine-1.2/lib/tasks/

6. Now: cd /usr/local/lib/redmine-1.2

7. And: rake jira_migration:test_all_migrations RAILS_ENV="production"
Before this command we are getting a file called "map_jira_to_redmine.yml"

8. Edit this file with the editor you want (vi, pico, nano...). For instance: pico map_jira_to_redmine.yml

9. This file contains the priorities, types and status of your Jira Projects. On the left side Jira Features, On the right side Redmine Features. You can adjust your Redmine, for example the trackers in the Administration web section to link exactly with the features of your Jira Projects. You can do it the same process with the states and priorities.

10. Once you set this file. You only have to run this: rake jira_migration:do_all_migrations RAILS_ENV="production"

I hope this help to somebody!!

Thanks a lot to Luciano Pacheco by his time and work developing scripts!

#44 Updated by Luciano Pacheco almost 6 years ago

Thanks Carlos by improving the documentation.

About creating users in projects. In my case, my company was re-organizing the projects and users, so users were created before migration of tickets.

But in case somebody needs it, you can "stole" from other script, see the relevant part here :
http://www.redmine.org/attachments/6097/migrate_from_jira.rake#L152 ;-)

#45 Updated by Nicolas Kopp almost 6 years ago

seems to work fine following Carlos' HowTo, until we reach this point:

rake aborted!
private method `sub' called for nil:NilClass
C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/redmine/lib/tasks/m
igrate_jira.rake:193:in `red_lastname'
C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/redmine/lib/tasks/m
igrate_jira.rake:72:in `send'
C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/redmine/lib/tasks/m
igrate_jira.rake:72:in `run_all_redmine_fields'
C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/redmine/lib/tasks/m
igrate_jira.rake:68:in `each'
C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/redmine/lib/tasks/m
igrate_jira.rake:68:in `run_all_redmine_fields'
C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/redmine/lib/tasks/m
igrate_jira.rake:78:in `migrate'
C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/redmine/lib/tasks/m
igrate_jira.rake:183:in `migrate'
C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/redmine/lib/tasks/m
igrate_jira.rake:600
C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/redmine/lib/tasks/m
igrate_jira.rake:598:in `each'
C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/redmine/lib/tasks/m
igrate_jira.rake:598
C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `call'
C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `execute'
C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `each'
C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in `invoke_with_cal
l_chain'
C:/Ruby187/lib/ruby/1.8/monitor.rb:242:in `synchronize'
C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_cal
l_chain'
C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:607:in `invoke_prerequi
sites'
C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:604:in `each'
C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:604:in `invoke_prerequi
sites'
C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:596:in `invoke_with_cal
l_chain'
C:/Ruby187/lib/ruby/1.8/monitor.rb:242:in `synchronize'
C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_cal
l_chain'
C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'
C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_excep
tion_handling'
C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'
C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in `run'
C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_excep
tion_handling'
C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
C:/Ruby187/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31
C:/Ruby187/bin/rake:19:in `load'
C:/Ruby187/bin/rake:19

No Idea what that could be...

Any Ideas from you guys out there?

#46 Updated by Nicolas Kopp almost 6 years ago

oh and this happens right after the successful user import.

#47 Updated by Alexey Goldbergs over 5 years ago

Going through Carlos' HowTo but have the same issue as Anjani.
Accordingly to the trace the users is migrated

** Invoke jira_migration:migrate_users (first_time)
** Invoke environment
** Execute jira_migration:migrate_users

But there're no migrated users in Redmine (Administration->Users) and when issues migration started I have an error:
Validation failed: Author can't be blank

I have just one difference from Anjani's error that I'm using rake v.0.8.7 instead of v.0.9.2 because accordingly to the Redmine installation guide rake 0.9.x is not supported by Rails yet.
Any ideas on how to fix this?

#48 Updated by Rudy Attias about 5 years ago

I came across the same issues as Anjani and Alexey while migrating from Jira 5.0.6, it seems that they have change the XML backup format. I've adjusted migrate_jira.rake to work for me and its attached to this post, enjoy.

#49 Updated by Mario Wündsch over 4 years ago

Hi all,

Jira Version 5.1 is now the current version. The jira backup is now an zip file which contains a "entities.xml" and a "activeobjects.xml". I think atlassian have changed it complete.
I read all comment but I am not sure, if the the RSS import is working now.

I think do have a better support possibility we should open a github project for the jira redmine import. I've created one : https://github.com/wuendsch/jira2redmine I will take your rake files and patches and commit it to the repo. I will try it, but It will be better if I have some help here. Please inform me or better collaborate with me directly on github.

Thank you
Mario

#50 Updated by Loris Eynard over 2 years ago

Hello all,

I made it works for me.
My version are:
- Jira version 6.4-OD-13-026
- Redmine 2.6.1-0

If this can help I share what I've done to make it works for me:
- In Jira, go to Administration--> System --> Backup manager and perform a backup.
- Copy the script migrate_jira.rake in redmine/htdocs/lib/tasks (as my instal ir from redmine it is in /myinstall_of_redmine/apps/redmine/htdocs/…)
- copy the backup in …/redmine/htdocs/)
- run rake jira_migration:test_all_migrations RAILS_ENV="production" , a file map_jira_to_redmine.yml is created
- modify this file according to your issues types, status and priorities
- I had to modify the script because in my Jira export, the firstName tag of user was empty. So I modified the script line 459.
- then run rake jira_migration:do_all_migrations RAILS_ENV="production"

Voila.
Hope this helps.

p.s: I've seen Carlos Scaloni post after starting mine so I decided to post anyway ;)

#51 Updated by Rémy L over 2 years ago

I guys, i have some issues when i attempt to run (rake jira_migration:test_all_migrations RAILS_ENV="production") command.
I have a nice "rake aborted !" "cannot load such file -- config/environment" and many things like "/usr/local/rvm/gems/ruby-2.0.0-p598/gems/activesupport-3.2.19/lib/active_support/dependencies.rb:251:in `require'"

My Environment:
Redmine version 2.5.3.stable.14044
Ruby version 2.0.0-p598 (2014-11-13) [x86_64-linux]
Rails version 3.2.19
Environment production
Database adapter Mysql2

My Gem version:
2.4.3

If you have any idea ..

Also available in: Atom PDF