Giter VIP home page Giter VIP logo

redmine-gitlab-migrator's Introduction

Redmine to Gitlab migrator

Build Status

Migrate code projects from Redmine to Gitlab, keeping issues/milestones/metadata

Does

  • Per-project migrations
  • Migration of issues, keeping as much metadata as possible:
    • redmine trackers become tags
    • redmine categories become tags
    • issues comments are kept and assigned to the right users
    • issues final status (open/closed) are kept along with open/close date (not detailed status history)
    • issues assignments are kept
    • issues numbers (ex: #123)
    • issues/notes authors
    • issues/notes original dates, but as comments
    • issue attachments
    • issue related changesets
    • issues custom fields (if specified)
    • relations including children and parent (although gitlab model for relations is simpler)
    • keep creation/edit dates as metadata
    • remember who closed the issue
    • convert Redmine's textile format issues to GitLab's markdown
    • possible to map to different users in GitLab
  • Migration of Versions/Roadmaps keeping:
    • issues composing the version
    • statuses & due dates
  • Migration of wiki pages including history:
    • versions become older commits
    • author names (without email addresses!) are the author/committer names

Does not

  • Migrate users, groups, and permissions (redmine ACL model is complex and cannot be transposed 1-1 to gitlab ACL)
  • Migrate repositories (piece of cake to do by hand, + redmine allows multiple repositories per project where gitlab does not)
  • Migrate the whole redmine installation at once, because namespacing is different in redmine and gitlab
  • Archive the redmine project for you
  • Keep "watchers" on tickets (gitlab API v3 does not expose it)
  • Keep dates/times as metadata
  • Keep track of issue relations orientation (no such notion on gitlab)
  • Migrate tags (redmine_tags plugin), as they are not exposed in gitlab API

Requires

  • Python >= 3.5
  • gitlab >= 7.0
  • redmine >= 1.3
  • pandoc >= 1.17.0.0
  • API token on redmine
  • API token on gitlab
  • No preexisting issues on gitlab project
  • Already synced users (those required in the project you are migrating)

(Original version was developed/tested around redmine 2.5.2, gitlab 8.2.0, python 3.4) (Updated version was developed/tested around redmine 3.2.0, gitlab 12.3, python 3.6.8)

Let's go

You can or can not use virtualenvs, that's up to you.

Install it:

pip install redmine-gitlab-migrator

or latest version from GitHub:

pip install git+https://github.com/redmine-gitlab-migrator/redmine-gitlab-migrator

or if you cloned the git:

python setup.py install

You can then give it a check without touching anything:

migrate-rg issues --redmine-key xxxx --gitlab-key xxxx \
  <redmine project url> <gitlab project url> --check

The --check here prevents any writing , it's available on all commands.

migrate-rg --help

Migration process

This process is for each project, order matters.

Create the gitlab project

It doesn't need to be named the same, you just have to record its URL (eg: https://git.example.com/mygroup/myproject).

Create users

Manual operation, project members in gitlab need to have the same username as members in redmine. If you can't use same username in gitlab, e.g. migrating to gitlab.com, when migrating issues you can create a mappings file with yaml format, mapping redmine login to gitlab login, with

--user-dict <user dict file>

Every member that interacted with the redmine project should be added to the gitlab project. If a corresponding user can't be found in gitlab, the issue/comment will be assigned to the gitlab admin user.

redmine_user0: gitlab_user0
redmine_user1: gitlab_user1

For example, say that you have user on Redmine with username bar and that same user on GitLab has username foo. You can save your mapping to users.yml file with the following content:

bar: foo

and then run the migration with migrate-rg --user-dict users.yml, among other flags, assuming you are running the migration from the same directory where you stored your user mapping.

Migrate Roadmap

If you do use roadmaps, redmine versions will be converted to gitlab milestones. If you don't, just skip this step.

migrate-rg roadmap --redmine-key xxxx --gitlab-key xxxx \
  https://redmine.example.com/projects/myproject \
  http://git.example.com/mygroup/myproject --check

(remove --check to perform it for real, same applies for other commands)

Migrate issues

migrate-rg issues --redmine-key xxxx --gitlab-key xxxx \
  https://redmine.example.com/projects/myproject \
  http://git.example.com/mygroup/myproject --check

Note that your issue titles will be annotated with the original redmine issue ID, like -RM-1186-MR-logging. This annotation will be used (and removed) by the next step.

If you don't have direct access to the gitlab machine, e.g. migrating to gitlab.com, and you want to keep redmine id, use --keep-id, it will create and delete issues in gitlab for each id gap in redmine project, and won't create issues with different title. If you have many issues in your redmine projects, it will be a slow process.

--keep-id

At least redmine 2.1.2 has no closed_on field, so you have to specify the names of the states which define closed issues. defaults to closed,rejected

--closed-states closed,rejected,wontfix

If you want to migrate redmine custom fields (as description), you can specify

--custom-fields Customer,ZendeskIssueId

If you're using SSL with self signed certificates and get an requests.exceptions.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:600) error, you can disable certificate validation with

--no-verify

Migrate issues get all users in gitlab. If you have many users in your gitlab, e.g. migrating to gitlab.com, it will be a slow process. You can use --project-members-only to query project members instead of all users, if corresponding user can't be found in project members, the issue/comment will be assigned to the gitlab admin user.

--project-members-only

If you don't have admin access to gitlab instance, e.g. migrating to gitlab.com, sudo_user is not allowed, so you have to disable sudo with

--no-sudo

If Markdown is used in Redmine, textile conversion can be skipped with

--no-textile

Migrate Issues ID (iid)

You can retain the issues ID from redmine, this cannot be done via REST API, thus it requires direct access to the gitlab machine.

So you have to log in the gitlab machine (eg. via SSH), and then issue the command with sufficient rights, from there:

migrate-rg iid --gitlab-key xxxx \
  http://git.example.com/mygroup/myproject --check

Migrate wiki pages

First, clone the GitLab wiki repository (go to your project's Wiki on GitLab, click on "Git Access" and copy the URL) somewhere local to your machine. The conversion process works even if there are pre-existing wiki pages, however this is NOT recommended.

migrate-rg pages --redmine-key xxxx --gitlab-wiki xxxx \
  https://redmine.example.com/projects/myproject \

where gitlab-wiki should be the path to the cloned repository (must be local to your machine). Add "--no-history" if you do not want the old versions of each page to be converted, too.

After conversion, verify that everything is correct (a copy of the original wiki page is included in the repo, however not added/committed), and then simply push it back to GitLab.

Import git repository

A bare matter of git remote set-url && git push, see git documentation.

Note that gitlab does not support multiple repositories per project, you'll have to reorganize your projects if you were using that feature of Redmine.

Delete all issues from gitlab

Primarily for redos in case something wasn't configured as intended

migrate-rg delete-issues --debug --gitlab-key xxx https://git.example.com/mygroup/myproject

Archive redmine project

If you want to.

You're good to go :).

Optional: Redirect redmine to gitlab (for apache)

Since redmine has a common https://redmine.company.tld/issues/{issueid} url for issues, you can't create a generic redirect in apache.

This command creates redirect rules that you can place in your .htaccess file.

migrate-rg redirect --redmine-key xxxx --gitlab-key xxxx \
  https://redmine.example.com/projects/myproject \
  http://git.example.com/mygroup/myproject > htaccess.example

The content of htaccess.example will be

# uncomment next line to enable RewriteEngine
# RewriteEngine On
# Redirects from https://redmine.example.com/projects/myproject to https://git.example.com/mygroup/myproject
RedirectMatch 301 ^/issues/1$ https://git.example.com/mygroup/myproject/issues/1
RedirectMatch 301 ^/issues/2$ https://git.example.com/mygroup/myproject/issues/2
...
RedirectMatch 301 ^/issues/999$ https://git.example.com/mygroup/myproject/999

Unit testing

Use the standard way:

python setup.py test

Or use whatever test runner you fancy.

Using Docker container

Start up GitLab with migrator

cf. GitLab Docs > Omnibus GitLab Doc > GitLab Docker images

export GITLAB_HOME=$PWD/srv/gitlab
docker-compose up -d
docker-compose logs -f  # You can watch logs and stop with Ctrl+C

After starting a container you can access GitLab http://localhost:8081

  • Create group/project and users
  • Create Access Token

Migrate with docker-compose command

Roadmap

docker-compose exec migrator \
  migrate-rg roadmap --redmine-key xxxx --gitlab-key xxxx \
  https://redmine.example.com/projects/myproject \
  http://localhost:8081/mygroup/myproject

Issues

docker-compose exec migrator \
  migrate-rg issues --redmine-key xxxx --gitlab-key xxxx \
  https://redmine.example.com/projects/myproject \
  http://localhost:8081/mygroup/myproject

Issues ID (iid)

docker-compose exec migrator \
  migrate-rg iid --gitlab-key xxxx \
  http://localhost:8081/mygroup/myproject

Export/Import to production system

cf. GitLab Docs GitLab Docs > User Docs > Projects > Project settings > Project import/export

redmine-gitlab-migrator's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

redmine-gitlab-migrator's Issues

Wiki start page will overwritten by other top pages

This kind of wiki structure pattern

redmine-wiki

$ migrate-rg pages --redmine-key my_redmine_key \
  --gitlab-wiki ~/tmp/test.wiki \
  http://localhost/projects/test

migrate-rg creates these pages

  • Wik -> home.md
  • WikiTopPage2 -> home.md (overwrite)
  • WikiTopPage3 -> home.md (overwrite)
$ cd ~/tmp/test.wiki
$ ls -l *.md
.rw-r--r-- 84 hideyuki staff 2020-08-15 17:52 ChiledPage1.md
.rw-r--r-- 39 hideyuki staff 2020-08-15 17:52 ChiledPage2.md
.rw-r--r-- 33 hideyuki staff 2020-08-15 17:52 GrandchildPage1.md
.rw-r--r-- 27 hideyuki staff 2020-08-15 17:52 home.md

WikiTopPage2.md, WikiTopPage3.md are not created and home.md is overwritten.

I'm tested on

  • Redmine 4.1.1 (docker official image)
  • 6992a60

// Maybe, I will fix this issue... OK?

neither pip install nor setup.py install work

Hi,

thanks for the migrator package, unfortunately it does not work for me as it complained about a logging issue.
Second try cloning the repository, python setup.py install, give it a try by only running migrate-rg:

root@mfdev2:/home/mf/gitlab# migrate-rg 
Traceback (most recent call last):
  File "/usr/local/bin/migrate-rg", line 11, in <module>
    load_entry_point('redmine-gitlab-migrator==1.0.3', 'console_scripts', 'migrate-rg')()
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 561, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2631, in load_entry_point
    return ep.load()
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2291, in load
    return self.resolve()
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2297, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "build/bdist.linux-x86_64/egg/redmine_gitlab_migrator/commands.py", line 8, in <module>
    (exitstatus, outtext) = commands.getstatusoutput(cmd)
  File "build/bdist.linux-x86_64/egg/redmine_gitlab_migrator/gitlab.py", line 6, in <module>
ImportError: No module named request
root@mfdev2:/home/mf/gitlab# 

any idea what's wrong?

Martin

Error when trying to match user accounts

Greetings..

I'm in the process of migrating the issue tracking system for a small R&D team from Redmine to GitLab, found this migration script a couple days back, but I only got to try it out properly today. Please could someone help me work out what's going wrong here?

Quick environment overview for reference:

  • Local Redmine 2.6.6 (local server), running at http://redmine.nortechza.net
  • Hosted GitLab 8.9 (not my server), running at https://gitlab.com
  • Running this script from inside a Linuxmint VM in VirtualBox with "Bridged Networking" (I am behind a proxy, but it is configured and working perfectly for desktop apps and apt-get commands)

At first my Redmine username (login) was agreeff, while my GitLab username (as seen in the URL gitlab.com/u/<username>) is AndreGreeff. Since I maintain my own Redmine instance, I manually edited my username in the DB directly to match my GitLab account. Unfortunately I still receive the same error. The GitLab project is private, so you won't be able to see anything at the URLs listed below.

As for the projects themselves, I created brand new dummy projects on both sides and added 3 versions and 3 issues to my dummy Redmine project specifically for testing this.

One the console I see:

andre@mint-dev1 ~/redmine-gitlab-migrator $ migrate-rg issues --redmine-key <xxx> --gitlab-key <xxx> http://redmine.nortechza.net/projects/dummy-project https://gitlab.com/nortech-sandbox/dummy-project --check
INFO: Project users are: AndreGreeff 
ERROR: Required users presence... FAILED

Before editing my Redmine username, the INFO line showed the name agreeff, so I know my change did take effect.

I wasn't sure which token to use from GitLab's side, so I tried with both the "Private Token" under the "Account" tab and with creating a new token under the "Personal Access Tokens" tab, but I get the exact same behaviour either way.

Am I missing something here..? Any ideas of what I could check / try? Is it possible to run this with debug output to see what the script is doing at each internal step?

Hierarchy of wiki pages gets lost

When migrating the wiki using the proposed way of the Readme (via local cloning, migrating and pushing) the hierarchy of wiki pages gets lost. For example:

  • Page 1
    • Page 1.2

is converted to

  • Page 1
  • Page 2.

Using subdirectories in the Gitlab wiki could solve this problem.

Working environment:

  • Redmine 2.3.0.stable
  • current HEAD of fork from @johan-smits (32851bb) on Debian Jessie with Python 3.4.2

All issues attributed to current admin

Dear all,
I try to migrate from Redmine 2.5.1 to Gitlab 11.1.4, using the version of redmine-gitlab-migrator provided by the pull request #35 (because of API version).

The issues are imported in Gitlab but redmine-gitlab-migrator fails to match users, displaying such messages:

WARNING: Redmine user {'id': 5, 'name': 'Luc XXX'} is unknown, attribute note to current admin
WARNING: Redmine user {'id': 57, 'name': 'Evan XXX'} is unknown, attribute note to current admin
WARNING: Redmine user {'id': 202, 'name': 'Maxime XXX'} is unknown, attribute note to current admin
WARNING: Redmine user {'id': 262, 'name': 'Yannick XXX'} is unknown, attribute note to current admin

May be I am wrong (I am not familiar with Python), but I added few instructions to display the Redmine users dictionary. It seems that the 'login' key is not retrieved by the script, even if this key is used by some functions:

  {
    "created_on": "2011-01-10T16:54:17Z",
    "lastname": "XXX",
    "firstname": "Luc",
    "id": 5,
    "last_login_on": "2018-08-01T14:09:00Z"
  },
  {
    "created_on": "2012-07-05T13:54:09Z",
    "lastname": "XXX",
    "firstname": "Evan",
    "id": 57,
    "last_login_on": "2018-07-18T12:18:22Z"
  },
  {
    "created_on": "2016-11-22T08:27:39Z",
    "lastname": "XXX",
    "firstname": "Maxime",
    "id": 202,
    "last_login_on": "2018-06-19T13:28:30Z"
  },
  {
    "created_on": "2017-05-19T13:30:51Z",
    "lastname": "XXX",
    "firstname": "Yannick",
    "id": 262,
    "last_login_on": "2018-08-02T17:42:29Z"
  },

Am I mistaken? Otherwise, is there a workaround?

Sébastien

Update internal ID counter for new issues after migrating IIDs

This can be done with:

UPDATE internal_ids SET last_value=? where project_id = ? and usage = 0;

I've searched a long time for this. You can do it manually if creating an issue fails after migrating. It should be included in the code.

A good "last_value" can be found with

SELECT max(iid) FROM issues WHERE project_id = ?;

404 Client error when importing issues

I created an empty project in Gitlab, and imported milestones from redmine with migrate-rg roadmap. This worked. The check for issue import worked as well:

migrate-rg issues --redmine-key XXXX --gitlab-key T5rbAsy6snApZPFbt5-w https://our.redmine.com/projects/migratie-test-project http://localhost/root/testproject --check
INFO: Project users are: PoppeJa 
INFO: Required users presence... OK
INFO: Project has no pre-existing issue... OK
INFO: Would create issue "-RM-5586-MR-sub task test" and 0 notes.
INFO: Would create issue "-RM-5585-MR-related issue test 2" and 0 notes.
INFO: Would create issue "-RM-5584-MR-related issue test 1" and 0 notes.
INFO: Would create issue "-RM-5583-MR-Standaard issue test" and 1 notes.

But importing without --check failed:

root@localhost:/# migrate-rg issues --redmine-key XXXX --gitlab-key T5rbAsy6snApZPFbt5-w https://our.redmine.com/projects/migratie-test-project http://localhost/root/testproject        
INFO: Project users are: PoppeJa 
INFO: Required users presence... OK
INFO: Project has no pre-existing issue... OK
Traceback (most recent call last):
  File "/opt/gitlab/embedded/bin/migrate-rg", line 9, in <module>
    load_entry_point('redmine-gitlab-migrator==1.0.2', 'console_scripts', 'migrate-rg')()
  File "/opt/gitlab/embedded/lib/python3.4/site-packages/redmine_gitlab_migrator/commands.py", line 237, in main
    args.func(args)
  File "/opt/gitlab/embedded/lib/python3.4/site-packages/redmine_gitlab_migrator/commands.py", line 146, in perform_migrate_issues
    created = gitlab_project.create_issue(data, meta)
  File "/opt/gitlab/embedded/lib/python3.4/site-packages/redmine_gitlab_migrator/gitlab.py", line 71, in create_issue
    issues_url, data=data, headers={'SUDO': meta['sudo_user']})
  File "/opt/gitlab/embedded/lib/python3.4/site-packages/redmine_gitlab_migrator/__init__.py", line 40, in post
    return self._req(requests.post, *args, **kwargs)
  File "/opt/gitlab/embedded/lib/python3.4/site-packages/redmine_gitlab_migrator/__init__.py", line 31, in _req
    resp.raise_for_status()
  File "/opt/gitlab/embedded/lib/python3.4/site-packages/requests/models.py", line 884, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: http://localhost/api/v3/projects/root%2Ftestproject/issues

I am using gitlab 8.13.6, and redmine-gitlab-migrator 1.0.2.

Any suggestions?

Thank you,
Johan

Wiki links do not work after migration

Hi and thanks for the good work!

The migration of wiki pages from Redmine 4.0.7 to GitLab CE 14.2.3 went through without any problems, but unfortunatelly browsing through the Wiki inside GitLab is impossible since the generated links lack the .md extension of the target page.

This leads to "{Site}" did not exist on "{branch}" errors in GitLab when clicking on any link inside the Wiki.

TypeError: list indices must be integers, not str

Trying to migrate milestones or issues gives this error :

INFO: Project users are: ***,***,****
INFO: Required users presence... OK
INFO: Project has no pre-existing issue... OK
Traceback (most recent call last):
  File "/usr/local/bin/migrate-rg", line 9, in <module>
    load_entry_point('redmine-gitlab-migrator==1.0.2', 'console_scripts', 'migrate-rg')()
  File "/usr/local/lib/python3.4/dist-packages/redmine_gitlab_migrator/commands.py", line 237, in main
    args.func(args)
  File "/usr/local/lib/python3.4/dist-packages/redmine_gitlab_migrator/commands.py", line 146, in perform_migrate_issues
    created = gitlab_project.create_issue(data, meta)
  File "/usr/local/lib/python3.4/dist-packages/redmine_gitlab_migrator/gitlab.py", line 73, in create_issue
    issue_url = '{}/{}'.format(issues_url, issue['id'])
TypeError: list indices must be integers, not str

Any idea of what cause this bug ?

Redmine 2.3.3
Gitlab 8.9.4
Python 3.4

Gitlab website assume to be at root of URL

I realize this project is [probably] not maintained these days, but in case anyone stumbles upon this with the same issue...

It appears that commit e8c8769 (support for gitlab sub-projects) has caused the gitlab Base URL to be assumed to be at the root level.

For example:

https://my-git-repo.com/namespace/project works fine, but
https://my-company.com/git/namespace/project does not. It is parsed into "git" as the namespace and "namespace" is the project, with "project" as the sub-project. Which will fail.

There is obviously a need to support sub-projects in Gitlab, and the only way around this issue that I can see is to provide the Gitlab base URL as a separate argument so that there are no ambiguities. Otherwise I don't think there's an easy way to distinguish non-root base URLs and sub-projects. Maybe possible with multiple parsing attempts and probing for existing projects after each parse to see if the project is found??

For a temporary fix, I'm simply reversing that change in the version I have so it will work for me. It's a one-line edit to gitlab.py. That works for me since I don't have any sub-projects.

Please note that in order to run this package these days, you need to get the latest version from gitlab (NOT the version you get via pip). And then apply PR #35. (I applied the PR manually)

Exit with UnboundLocalError.

EXPECTED RESULTS

Normal execution with no errors.

ACTUAL RESULTS

Exit with an error.

ENVIRONMENT

Dockerhub python - Official Image

STEPS TO REPRODUCE

INSTALL

# pip3 install --use-pep517 --upgrade \
  pip \
  wheel \
  simplejson \
  pypandoc \
  pypandoc-binary \
  git+https://github.com/redmine-gitlab-migrator/redmine-gitlab-migrator

VERSIONS

$ python3 -V
Python 3.11.1

$ pip3 list
Package                 Version
----------------------- ---------
certifi                 2022.12.7
charset-normalizer      3.0.1
gitdb                   4.0.10
GitPython               3.1.30
idna                    3.4
pip                     22.3.1
pypandoc                1.10
pypandoc-binary         1.10
PyYAML                  6.0
redmine-gitlab-migrator 1.0.3
requests                2.28.2
setuptools              65.5.1
simplejson              3.18.1
smmap                   5.0.0
urllib3                 1.26.14
wheel                   0.38.4

OPARATION

$ migrate-rg issues --no-verify --no-sudo --redmine-key **************************************** --gitlab-key ************************** https://redmine.*******.org/projects/test1 https://gitlab.*******.org/testuser/test2
Traceback (most recent call last):
  File "/usr/local/bin/migrate-rg", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/local/lib/python3.11/site-packages/redmine_gitlab_migrator/commands.py", line 420, in main
    args.func(args)
  File "/usr/local/lib/python3.11/site-packages/redmine_gitlab_migrator/commands.py", line 244, in perform_migrate_issues
    gitlab_users_index = gitlab_instance.get_users_index()
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/redmine_gitlab_migrator/gitlab.py", line 47, in get_users_index
    return {i['username']: i for i in self.get_all_users()}
                                      ^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/redmine_gitlab_migrator/gitlab.py", line 42, in get_all_users
    return self.api.get('{}/users'.format(self.url))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/redmine_gitlab_migrator/gitlab.py", line 23, in get
    result = super().get(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/redmine_gitlab_migrator/__init__.py", line 58, in get
    return self._req(requests.get, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/redmine_gitlab_migrator/__init__.py", line 55, in _req
    return ret
           ^^^
UnboundLocalError: cannot access local variable 'ret' where it is not associated with a value

Pass human_time_estimate and human_total_time_spent to create_issue when keep-ids is enabled

Running master version with keep-ids enabled fails with KeyError 'human_time_estimate' in redmine_gitlab_migrator/gitlab.py:191 :

 > migrate-rg issues --redmine-key $REDMINE_KEY --gitlab-key $GITLAB_KEY --keep-id --keep-title --user-dict users.yml http://redmine.localdomain/projects/project http://gitlab.localdomain/project
unable to retrieve user!
INFO: Getting redmine issues
INFO: Converting issues
INFO: Creating gitlab issues
INFO: create issue "fake" failed
Traceback (most recent call last):
  File "/home/oc/Projects/redmine-gitlab-migrator/.venv/bin/migrate-rg", line 11, in <module>
    load_entry_point('redmine-gitlab-migrator==1.0.3', 'console_scripts', 'migrate-rg')()
  File "/home/oc/Projects/redmine-gitlab-migrator/.venv/lib/python3.8/site-packages/redmine_gitlab_migrator-1.0.3-py3.8.egg/redmine_gitlab_migrator/commands.py", line 412, in main
  File "/home/oc/Projects/redmine-gitlab-migrator/.venv/lib/python3.8/site-packages/redmine_gitlab_migrator-1.0.3-py3.8.egg/redmine_gitlab_migrator/commands.py", line 274, in perform_migrate_issues
  File "/home/oc/Projects/redmine-gitlab-migrator/.venv/lib/python3.8/site-packages/redmine_gitlab_migrator-1.0.3-py3.8.egg/redmine_gitlab_migrator/gitlab.py", line 191, in create_issue
KeyError: 'human_time_estimate'

Defining the key human_time_estimate in redmine_gitlab_migrator/commands.py:270 with value None leads to next KeyError 'human_total_time_spent':

INFO: create issue "fake" failed
Traceback (most recent call last):
  File "/home/oc/Projects/redmine-gitlab-migrator/.venv/bin/migrate-rg", line 11, in <module>
    load_entry_point('redmine-gitlab-migrator==1.0.3', 'console_scripts', 'migrate-rg')()
  File "/home/oc/Projects/redmine-gitlab-migrator/.venv/lib/python3.8/site-packages/redmine_gitlab_migrator-1.0.3-py3.8.egg/redmine_gitlab_migrator/commands.py", line 412, in main
  File "/home/oc/Projects/redmine-gitlab-migrator/.venv/lib/python3.8/site-packages/redmine_gitlab_migrator-1.0.3-py3.8.egg/redmine_gitlab_migrator/commands.py", line 274, in perform_migrate_issues
  File "/home/oc/Projects/redmine-gitlab-migrator/.venv/lib/python3.8/site-packages/redmine_gitlab_migrator-1.0.3-py3.8.egg/redmine_gitlab_migrator/gitlab.py", line 194, in create_issue
KeyError: 'human_total_time_spent'

Defining the additional key human_total_time_spent with None in fake_meta dictionary fixes the issue and enables the creation of fake issues.

Gitlab v3 -> v4 api possible solution

Hi,

after digging a bit into, i discovered to change v3 api namespace to v4 only is not enough. (#31)
I also had to change the return from get_id former "id". "id" is the global issue ID and not the project related "iid". So this "id" and cannot be used if any issue was created in gitlab before. Otherwise it will raise an exception cause, the issue_url["id"] is pointing to the global id number and not to the corresponding project issue id.

How do i can create a pull request directly? I dont want to fork this project again.

Unable to migrate wiki from Redmine to GitLab

Hi, I'm trying to import wiki and I have this error:

fsolans@fsolans-ThinkPad-L430:~$ sudo migrate-rg pages --redmine-key XXX --gitlab-wiki czdecoder.wiki.git http://xxxprojects/xxdecoder
Collecting Conceptos_código_fuente
Traceback (most recent call last):
File "/usr/local/bin/migrate-rg", line 11, in
load_entry_point('redmine-gitlab-migrator==1.0.3', 'console_scripts', 'migrate-rg')()
File "/usr/local/lib/python3.6/dist-packages/redmine_gitlab_migrator-1.0.3-py3.6.egg/redmine_gitlab_migrator/commands.py", line 396, in main
File "/usr/local/lib/python3.6/dist-packages/redmine_gitlab_migrator-1.0.3-py3.6.egg/redmine_gitlab_migrator/commands.py", line 185, in perform_migrate_pages
TypeError: must be str, not int

Any idea ? Thks !

migrate iid issue mentions

I haven't used perform_migrate_iid yet as I'm yet to find how to refresh the "commit mentions" after running this command.

There is no gitlab rake task for it so I guess mangling with the database will be required as well.

Example:

  • Create project
  • Create issue #1
  • Commit something with "test for #2"
  • Nothing shows on iid 1 page
  • Update iid 1 to 2
  • Check page and nothing shows either

Expected: see commit "test for #2" mentioned in the issue page, now that its iid is #2

So far, I can only see mangling with notes table, but that does sound very clean..

Importing issues in Markdown.

Hi, I have my redmine configured to be written in markdown mode (no textile).

So when issues are migrated, all markdown marks are escaped.

Is there any way to specify that all issues are written in markdown?

Regards.

Looking for maintainer(s) !

I have been shortly maintaining this project. But as I no longer use it, I don't and I won't maintain it. Neither @oasiswork/owners will, I think. That is why nothing happens on master since 2 years, despite the fact there seems to be small but renewed interest for the project (watch/issues/PR).

So what I suggest:

  • someone (ideally several people) start maintaining this project Who's in ?
  • We hand off to that people
    • github access
    • travis access
    • pip access

The project could be moved to a new org/person or left here, depending on new maintainers and @oasiswork/owners (@zacbri ?) wills.

So… who's in ?

cc @johanv @gyscos @scambra

migrate issues subscriptions

We state in the README : Keep "watchers" on tickets (gitlab API v3 does not expose it)

However, this is no longer true, the API allows to subscribe to a ticket, even in v3. Same applies for Merge requests. Along with impersonation, this should allow to migrate issues subscriptions.

Fix broken tests

Hi,

a fix for to make travis tests work again. (With HEAD of master)
To fix the broken tests for master HEAD at first you can correct the typo in line 435 orl.endswitch to url.endswitch .

HTTP 410 Client Error: Gone after GitLab V3 API deprecation

GitLab API v3 was deprecated on GitLab 9.0 and it's being removed on GitLab 11.0.

Running migrate-rg to migrate milestones and issues from Redmine to a GitLab instance running GitLab 11.0 (such as GitLab.com, which is running GitLab 11.0.0-rc12-ee at the moment), causes an exception to be raised:

Traceback (most recent call last):
  File "/home/danirod/.local/share/virtualenvs/p3-uq_ooE2q/bin/migrate-rg", line 11, in <module>
    sys.exit(main())
  File "/home/danirod/.local/share/virtualenvs/p3-uq_ooE2q/lib/python3.5/site-packages/redmine_gitlab_migrator/commands.py", line 237, in main
    args.func(args)
  File "/home/danirod/.local/share/virtualenvs/p3-uq_ooE2q/lib/python3.5/site-packages/redmine_gitlab_migrator/commands.py", line 212, in perform_migrate_roadmap
    gitlab_project=gitlab_project)
  File "/home/danirod/.local/share/virtualenvs/p3-uq_ooE2q/lib/python3.5/site-packages/redmine_gitlab_migrator/commands.py", line 72, in check
    ret = func(redmine_project, gitlab_project)
  File "/home/danirod/.local/share/virtualenvs/p3-uq_ooE2q/lib/python3.5/site-packages/redmine_gitlab_migrator/commands.py", line 94, in check_no_milestone
    return len(gitlab_project.get_milestones()) == 0
  File "/home/danirod/.local/share/virtualenvs/p3-uq_ooE2q/lib/python3.5/site-packages/redmine_gitlab_migrator/gitlab.py", line 117, in get_milestones
    '{}/milestones'.format(self.api_url))
  File "/home/danirod/.local/share/virtualenvs/p3-uq_ooE2q/lib/python3.5/site-packages/redmine_gitlab_migrator/gitlab.py", line 16, in get
    return super().get(*args, **kwargs)
  File "/home/danirod/.local/share/virtualenvs/p3-uq_ooE2q/lib/python3.5/site-packages/redmine_gitlab_migrator/__init__.py", line 37, in get
    return self._req(requests.get, *args, **kwargs)
  File "/home/danirod/.local/share/virtualenvs/p3-uq_ooE2q/lib/python3.5/site-packages/redmine_gitlab_migrator/__init__.py", line 31, in _req
    resp.raise_for_status()
  File "/home/danirod/.local/share/virtualenvs/p3-uq_ooE2q/lib/python3.5/site-packages/requests/models.py", line 939, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 410 Client Error: Gone for url: https://gitlab.com/api/v3/projects/[redacted]?per_page=100

Proposal: Assignment of redmine users who do not exist in gitlab to a person in charge

In the current spec, redmine users who do not exist in gitlab are set for root.
This is set in this part of commit 19c9740.

19c9740#diff-02a389cb27a0e3cb4a8d969d020bca5fe77d1649ba127062a9a8f3f110fcf108R14

def redmine_uid_to_gitlab_user(redmine_id, redmine_user_index, gitlab_user_index):
redmine_login = redmine_user_index[redmine_id]['login']
if not redmine_login in gitlab_user_index:
redmine_login = 'root'
return gitlab_user_index[redmine_login]

Later, commit e67aa99 added a no-sudo option to the issue command to allow migration to gitlab without administrative privileges.

This will cause mail notifications to be sent to root with a notification set to mention when the migration is performed by a regular user.
In the gitlab we run, there was an incident where 4000 mails were sent to root.

I think it is better to set the user of redmine that does not exist in gitlab to the user of gitlab api.

Issue import doesn't work with user group

Redmine 2.5.1.stable
Gitlab 8.6.4

$ migrate-rg issues --redmine-key 7c2526a96c8603b683c2ae00474e88e3d79db9ca --gitlab-key owH5yfdvXTQtS61PqQms \
→   http://xxx/redmine/projects/uwa3 \
→   http://xxx/gitlab/redmine-wap --check
Traceback (most recent call last):
  File "/usr/local/bin/migrate-rg", line 9, in <module>
    load_entry_point('redmine-gitlab-migrator==1.0.2', 'console_scripts', 'migrate-rg')()
  File "/usr/local/lib/python3.5/site-packages/redmine_gitlab_migrator-1.0.2-py3.5.egg/redmine_gitlab_migrator/commands.py", line 237, in main
  File "/usr/local/lib/python3.5/site-packages/redmine_gitlab_migrator-1.0.2-py3.5.egg/redmine_gitlab_migrator/commands.py", line 111, in perform_migrate_issues
  File "/usr/local/lib/python3.5/site-packages/redmine_gitlab_migrator-1.0.2-py3.5.egg/redmine_gitlab_migrator/redmine.py", line 121, in get_users_index
  File "/usr/local/lib/python3.5/site-packages/redmine_gitlab_migrator-1.0.2-py3.5.egg/redmine_gitlab_migrator/redmine.py", line 115, in get_participants
  File "/usr/local/lib/python3.5/site-packages/redmine_gitlab_migrator-1.0.2-py3.5.egg/redmine_gitlab_migrator/redmine.py", line 17, in get
  File "/usr/local/lib/python3.5/site-packages/redmine_gitlab_migrator-1.0.2-py3.5.egg/redmine_gitlab_migrator/__init__.py", line 37, in get
  File "/usr/local/lib/python3.5/site-packages/redmine_gitlab_migrator-1.0.2-py3.5.egg/redmine_gitlab_migrator/__init__.py", line 31, in _req
  File "/usr/local/lib/python3.5/site-packages/requests-2.10.0-py3.5.egg/requests/models.py", line 844, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error:  for url: http://xxx/redmine/users/3.json

But the user with the ID 3 exist, it's a user group:

redmine=> select * from users where id = 3
redmine-> ;
 id | login | hashed_password | firstname | lastname | mail | admin | status | last_login_on | language | auth_source_id |         created_on         |         updated_on         | type  | identity_url | mail_notification | salt | must_change_passwd
----+-------+-----------------+-----------+----------+------+-------+--------+---------------+----------+----------------+----------------------------+----------------------------+-------+--------------+-------------------+------+--------------------
  3 |       |                 |           | WAP      |      | f     |      1 |               |          |                | 2012-11-20 14:25:35.517177 | 2015-02-17 16:37:59.485267 | Group |              |                   |      | f
(1 row)

Add user mapping

Sometimes, having exact username match is not an option when migrating.
It would be nice to have the option of specifying a user mapping file to get the gitlab username for each redmine account - something like the authorsFile in git-svn.

--user-dict user name format unclear

Hi,

I want to use --user-dict to assign the proper users which differs between our redmine and gitlab installation.

Even if I use --user-dict I get a lot of warnings:

WARNING: Redmine issue #12623 assignee is anonymous. gitlab assinee is attributed to current admin

or

WARNING: Redmine user {'id': 565, 'name': 'Heidi Fischer'} is unknown, attribute note to current admin

No I'm wondering about the proper fromat of my mapping file. I assumed the following format:

Heidi Fischer: hfischer

whereas the gitlab username matches the one visible in https://gitlab.instance/profile/account. However, the proper redmine username is not clear to me, since for log in to the redmine instance the username is fischer.heidi (lastname.firstname) but activites in Redmine are labeled with Heidi Fischer (firstnam lastname). The latter is also shown up when calling https://redmine.instance/users/565.

In any case, I'm not able to get rid of the warnings :-(

Btw., I don't have access to the installation of the redmine and gitlab instance.

Problem with project containing versions

I get this error

INFO: Getting redmine issues
INFO: Converting issues
INFO: Creating gitlab issues
WARNING: Redmine issue #70 is anonymous, gitlab issue is attributed to current admin

Traceback (most recent call last):
  File "/opt/conda/bin/migrate-rg", line 11, in <module>
    load_entry_point('redmine-gitlab-migrator==1.0.3', 'console_scripts', 'migrate-rg')()
  File "/opt/conda/lib/python3.6/site-packages/redmine_gitlab_migrator-1.0.3-py3.6.egg/redmine_gitlab_migrator/commands.py", line 396, in main
  File "/opt/conda/lib/python3.6/site-packages/redmine_gitlab_migrator-1.0.3-py3.6.egg/redmine_gitlab_migrator/commands.py", line 246, in perform_migrate_issues
  File "/opt/conda/lib/python3.6/site-packages/redmine_gitlab_migrator-1.0.3-py3.6.egg/redmine_gitlab_migrator/commands.py", line 241, in <genexpr>
  File "/opt/conda/lib/python3.6/site-packages/redmine_gitlab_migrator-1.0.3-py3.6.egg/redmine_gitlab_migrator/converters.py", line 242, in convert_issue
KeyError: '1.0.0'

1.0.0 is the target version of issue #70 and the issue state is rejected.

Tool version on PyPi too old

When using the pip install command to retrieve the tool you'll only get version 1.0.2 which doesn't work with APIv4 in current GitLab versions. Instead it uses APIv3 which seems to not be available in GitLab anymore.

I recommend setting a new version tag on the current master branch state since it seems to run quite well with current GitLab installations. Will this update the PyPi version automatically as well?

Deleted users aren't attributed to GL admin user

It just takes the 404 for a deleted user and crashes with a

File "c:\users\-\documents\redmine-gitlab\venv\lib\site-packages\requests\models.py", line 893, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: http://mysite/redmine/users/3.json
(venv)

Create new code baseline?

Like many before me I am in the process if moving my Redmine projects to GitLab. I highly appreciate all the work that has gone into this project already but could not help noticing that several forks added much-needed functionality (wiki hierarchy and attachments the most prominent imho) and many small fixes which are not part of the code-base here.

So while the easy way would be to create a new fork, merge in the stuff I need and move on I'd like to take the opportunity to incorporate as much functionality and fixes into this code-base so others after me have it a bit easier. (This could solve #59, #37, possibly #4 & #14 and hopefully sparks new interest in #20.)

Main question: Is there actually an interest in supporting me in this? At the very least somebody would need to approve PRs but it certainly would not hurt to have someone to discuss with which changes should make it in. Also a new PyPI release could be a good idea at a certain point in the future.

I already took the liberty to go through all forks and check which commits might be of benefit when included but are not - this is what I have come up with so far:

Important features

wikipage tree hierarchy

Added migration of attachments for wiki pages

add arg for md textformat inside redmine

Improved importing of changesets, notes, attachments and labels (reqire Gitlab patches) (maybe)

Issue filtering by keyword/milestone

Minor Features & Fixes

Documentation & SCM

Wiki Import looses attachments

Hi, is there an convenient way to migrate the attachments as well? I figured out that it's ok to place them into the wiki git as well but I don't know how to easily extract it from redmine, the files directory stores all the attachments of alle the projects and wikis ?

thx Martin

403-error creating issues after recent update of gitlab (v. 8.14.4)

Technically this is not a bug in the redmine-gitlab-migrator, but I will just document this here in case someone bumps into this problem.

This is what I got when trying to migrate issues:

INFO: Project users are: PoppeJa 
INFO: Required users presence... OK
INFO: Project has no pre-existing issue... OK
Traceback (most recent call last):
  File "/var/www/vhosts/websites.chiro.be/migration/bin/migrate-rg", line 9, in <module>
    load_entry_point('redmine-gitlab-migrator==1.0.2', 'console_scripts', 'migrate-rg')()
  File "/var/www/vhosts/websites.chiro.be/migration/lib/python/redmine_gitlab_migrator-1.0.2-py3.4.egg/redmine_gitlab_migrator/commands.py", line 239, in main
  File "/var/www/vhosts/websites.chiro.be/migration/lib/python/redmine_gitlab_migrator-1.0.2-py3.4.egg/redmine_gitlab_migrator/commands.py", line 146, in perform_migrate_issues
  File "/var/www/vhosts/websites.chiro.be/migration/lib/python/redmine_gitlab_migrator-1.0.2-py3.4.egg/redmine_gitlab_migrator/gitlab.py", line 71, in create_issue
  File "/var/www/vhosts/websites.chiro.be/migration/lib/python/redmine_gitlab_migrator-1.0.2-py3.4.egg/redmine_gitlab_migrator/__init__.py", line 40, in post
  File "/var/www/vhosts/websites.chiro.be/migration/lib/python/redmine_gitlab_migrator-1.0.2-py3.4.egg/redmine_gitlab_migrator/__init__.py", line 31, in _req
  File "/var/www/vhosts/websites.chiro.be/migration/lib/python/requests-2.12.3-py3.4.egg/requests/models.py", line 893, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://gitlab.chiro.be/api/v3/projects/test%2Ftestmigratie/issues

This is caused by an issue in gitlab: https://gitlab.com/gitlab-org/gitlab-ce/issues/25481.

I guess this issue will soon be fixed, but in the mean time, you can work around it by applying the patch attached. Beware that if you apply this patch, all issues and comments will appear to be posted by the user corresponding to the gitlab-key you use for the migration.

gitab-sudo-workaround.zip

This is far from ideal. But if you need to migrate and you are stuck on a version of gitlab with this issue, it might be useful.

Attempts to retrieve all projects

If I'm following my debug output and the code correctly, it looks like instantiating GitlabClient attempts to retrieve a list of all the projects in the entire instance (which is untenable for gitlab.com-hosted setups).

Alternatively, maybe I'm doing something wrong...

Parameter `--user-dict` is not recognized

I don't know if it's a problem with documentation or it just don't work:

migrate-rg issues --redmine-key .... --gitlab-key ...  <url> <url> \
--user-dict userdict.yaml --project-members-only --check

Output:

migrate-rg: error: unrecognized arguments: --user-dict userdict.yaml --project-members-only

Unable to migrate roadmap - Project id not found

Redmine version : 3.2.0
GitLab version : 14.6.1

I followed the steps to migrate somme data from Redmine to GitLab but I'm stuck in the 1st step after the installation.
I created a GitLab Project :
image
But when I run the command :
migrate-rg roadmap -–redmine-key xxxxxxx -–gitlab-key xxxxxx http://redmine/projects/econnecteur https://xxxxxx/prestashop/xlpos -–check
The project is not found :
Traceback (most recent call last): File "c:\python39\lib\runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "c:\python39\lib\runpy.py", line 87, in _run_code exec(code, run_globals) File "C:\Python39\Scripts\migrate-rg.exe\__main__.py", line 7, in <module> File "c:\python39\lib\site-packages\redmine_gitlab_migrator\commands.py", line 412, in main args.func(args) File "c:\python39\lib\site-packages\redmine_gitlab_migrator\commands.py", line 365, in perform_migrate_roadmap gitlab_project = GitlabProject(args.gitlab_project_url, gitlab) File "c:\python39\lib\site-packages\redmine_gitlab_migrator\gitlab.py", line 95, in __init__ raise ValueError('Could not get project_id for path_with_namespace: {}'.format(path_with_namespace)) ValueError: Could not get project_id for path_with_namespace: prestashop/xlpos

ERROR: Required users presence... FAILED

I just installed redmine-gitlab-migrator via pip.

I get the following error while migrating issues

migrate-rg issues --redmine-key ... --gitlab-key ... https://redmine.company.tld/projects/my-project https://git.company.tld/namespace/my-project
INFO: Project users are: user1, user2, user3
ERROR: Required users presence... FAILED

I trible checked that all users exist on my gitlab server, I even added each individual explicitly as a project user with "reporter" permission and verified that they can access the project.

The only thing that is different: Since there are old users which do not belong to the project anymore and I want to avoid sending emails to them, I created stub email adresses which may differ, but the usernames are (even case sensitiv) identical.

"Sudo" token is no longer supported by Gitlab, migration impossible.

This is similar to #17 but more fatal. The Gitlab token generation no longer have "sudo" option, and previous "private key" is no longer available. So any key you generate will not work.

Current Gitlab and current script version from repo:

INFO: create issue "..... " failed
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.6/bin/migrate-rg", line 11, in <module>
    load_entry_point('redmine-gitlab-migrator==1.0.3', 'console_scripts', 'migrate-rg')()
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/redmine_gitlab_migrator-1.0.3-py3.6.egg/redmine_gitlab_migrator/commands.py", line 396, in main
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/redmine_gitlab_migrator-1.0.3-py3.6.egg/redmine_gitlab_migrator/commands.py", line 278, in perform_migrate_issues
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/redmine_gitlab_migrator-1.0.3-py3.6.egg/redmine_gitlab_migrator/gitlab.py", line 155, in create_issue
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/redmine_gitlab_migrator-1.0.3-py3.6.egg/redmine_gitlab_migrator/__init__.py", line 46, in post
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/redmine_gitlab_migrator-1.0.3-py3.6.egg/redmine_gitlab_migrator/__init__.py", line 37, in _req
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/requests/models.py", line 935, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://gitlab.com/api/v3/projects/432321/issues

Milestones were created correctly with the same token parameter. But issues can not be created.

Error migrating wiki

Hi, I am trying to migrate our wiki from Redmine 2.6.6 to GitLab 11.3.4 but the following error occurs:

Converting home (Wiki version 1)
Traceback (most recent call last):
File "/usr/local/bin/migrate-rg", line 11, in
load_entry_point('redmine-gitlab-migrator==1.0.3', 'console_scripts', 'migrate-rg')()
File "/usr/local/lib/python3.6/dist-packages/redmine_gitlab_migrator-1.0.3-py3.6.egg/redmine_gitlab_migrator/commands.py", line 396, in main
File "/usr/local/lib/python3.6/dist-packages/redmine_gitlab_migrator-1.0.3-py3.6.egg/redmine_gitlab_migrator/commands.py", line 196, in perform_migrate_pages
File "/usr/local/lib/python3.6/dist-packages/redmine_gitlab_migrator-1.0.3-py3.6.egg/redmine_gitlab_migrator/wiki.py", line 148, in convert
File "/usr/local/lib/python3.6/dist-packages/GitPython-2.1.11-py3.6.egg/git/index/base.py", line 741, in add
entries_added.extend(self._entries_for_paths(paths, path_rewriter, fprogress, entries))
File "/usr/local/lib/python3.6/dist-packages/GitPython-2.1.11-py3.6.egg/git/util.py", line 70, in wrapper
raise InvalidGitRepositoryError("Method '%s' cannot operate on bare repositories" % func.name)
git.exc.InvalidGitRepositoryError: Method '_entries_for_paths' cannot operate on bare repositories

Command that I am using:

migrate-rg pages --redmine-key REDMINE_KEY --gitlab-wiki /var/opt/gitlab/git-data/repositories/root/wiki-test.wiki.git/ REDMINE_PROJECT_URL

Python version:

python3
Python 3.6.6 (default, Sep 12 2018, 18:26:19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.