This script migrates milestones, issues and wiki pages from trac to GitLab.
Migrating a trac project to GitLab is a relatively complex process involving four steps:
This script takes care of the last two bullet points and provides help for the third one.
./collect-users.pyto extract the user names from Trac
migrate.cfgand create the users in GitLab
./migrate.py). Make sure you test it on a test project prior, if you run it twice against the same project you will get duplicated issues unless you're using direct access with overwrite set to yes.
Issues and milestones are copied to GitLab.
Wiki pages are copied to a folder on your machine and must be pushed into GitLab using wiki's git access.
The database model should correspond to the version of GitLab that you are using.
This repo contains models for multiple versions (gitlab_direct/model
To support a new version, use pwiz.py:
$ pwiz.py -e postgresql -u gitlab gitlabhq_production > gitlab_direct/model<version>.py
Manual updates must then be applied, see for instance the manual updates for 6.4.
The configuration must be located in a file named "migrate.cfg"
url- xmlrpc url to trac, e.g.
project_name- the destination project including the paths to it. Basically the rest of the clone url minus the ".git". E.g.
method- direct or api
access_token- the access token of the user creating all the issues. Found on the account page, e.g.
ssl_verify- set to
yesto verify SSL server certificates.
db-name- MySQL database name
db-user- MySQL user name
db-password- MySQL password
uploads- GitLab uploads directory
usernamesComma separed list of username mappings such as:
migrate- Should the wiki pages be converted?
target-directory- Directory in which the wiki pages should be written
migrate- Should we migrate issues and milestones?
LGPL license version 3.0 (see the licences directory).
And also, if you use the direct access to GitLab's database: