PHP console application to import Redmine tickets of one or multiple projects into a GitLab issue tracker. Retains original ticket numbers by overwriting existing GitLab issues and inserting dummy issues.
- Tested with Redmine installation that used “GitRemote” VCS integration.
- Dummy issues will be created as confidential.
- Dummy issues will receive the label “import/skipped”.
- Private issues notes will become public (see below).
- Does not import more than 100 milestones (pagination not implemented when accessing GitLab API)
- Does not import child issues/tasks as we do not use them at Fusonic.
- Does not import watchers as they are not exposed/accessible using GitLab API.
- Does not import issue relation types (e.g. “#1 blocks #2”) as GitLab issue links do not support them.
First, you need to create a config file containing access keys, assignee mapping, and mapping for Redmine ticket meta
data (tracker, status, priority, custom fields). See app/config/sample.json
. A JSON schema can be found
app/config/schema.json
. The config file MUST conform to that schema.
We recommend to use numeric project IDs only. GitLab's API does sometimes contain bugs regarding encoding/decoding of the alphanumeric project name. Will eventually lead to API responses with status code 404.
Then, run the import command:
$ bin/console do:import
If the import crashes (because GitLab is down or due to network problems, for example) you can perform a partial import
and skip already imported tickets using the --first-ticket-number
option:
$ bin/console do:import --first-ticket-number=1337
Find your own user ID via the GitLab API while you are logged in to your GitLab account:
https://gitlab.com/api/v4/users?username=allgaeuer.fabian
Redmine assignees without a corresponding GitLab user ID are discarded. Issues will then be created without an assignee.
Redmine does not expose via API whether a issue note is private or not. We therefore recommend to export and delete all private issue notes from Redmine's database prior performing the import:
SELECT * FROM journals WHERE private_notes = 1
This application has been used at Fusonic to import over 2600 tickets and nearly 40 versions into an existing GitLab repository. We were using GitLab and Redmine parallel before we decided to fully move to GitLab. As a result, new milestones were created in both GitLab (to set target versions on merge requests) and in Redmine (to set target versions on tickets).
All existing import tools were not able to import data into an existing GitLab repository, and they require raw DB access to retain original ticket numbers (which is impossible when using gitlab.com).