Jira offers a importer plugin (Codename JIM), which also supports Redmine. However, the import
- is very slow because not available time entries are fetched for each issue several times (even when disabled) which causes about 2-3h per 10000 issues of additional time to the process
- does not support the journal entries (except comments) of an issue in Redmine (information about who changed what, e.g. someone set the priority to x)
- uses issue numbers for the tickets which differ from the original ones in Redmine. All links in commits, issue descriptions as well as in comments are gone.
Since this is rather unacceptable for us, we need a way to solve those problems.
The best way to solve this seems to be the JSON import integrated in Jira. With that it is possible to import all issues with history, comments, relations, ... from Redmine and update the references to other issues in texts like the description or comments.
For additional fanciness, we are using babel-node with ES6.
The following preconditions have to be met for this to work correctly:
- Jira was started an the setup wizard is finished
- All users, custom fields, priorities, states, issue types and other used fields are set up
- The workflow is set up (including screens) and the states are correctly linked to the workflow
- The project is created and links to the workflow, states, ... are set up correctly
Generally said, the project in Jira should be ready for productive use.
After that, the JSON file can be generated with this tool and later be imported using the Jira JSON importer.
NOTE:
Create a Backup of your Jira instance before starting the import!
So you don't have to set it up all again,
because the import did not work out.
You can use npm run push-backup
and npm run pull-backup
if you are using docker
- Rename the
settings.ini.example
tosettings.ini
and adjust it accordingly. - Check the mappings in
entities/jiraIssue
and . You may need several tries to get it right - Read the code and understand what is happening
- Run
npm start
- All issues including journals and attachment information are downloaded from the Redmine server.
- Users are extracted from the issue fields and a mapping from Redmine to Jira users is generated.
- Redmine issues are converted to Jira issues using the mappings.
- The JSON file for the import to Jira is generated.
There are npm scripts available for easy testing with docker.
Check out package.json
for more information.
The attachmentServer.js
is basically a proxy for adding additional authorization headers.
I had to use this, because our redmine server is protected with an additional basic authentication.
It will redirect request for attachments to the redmine server.