Skip to content

Command line utility to migrate Trac tickets to GitLab issues

Notifications You must be signed in to change notification settings

Dachaz/trac-to-gitlab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

What is it?

This command line utility migrates Trac tickets to GitLab issues using Trac and GitLab APIs.

Features

  • Migrates open tickets of a single Trac component
  • Migrates any tickets matching a specific Trac query
  • Migrates comments on the tickets to notes on the issues
  • Keeps the original author and assignee when migrating (also for comments)
  • Supports mapping Trac usernames to GitLab usernames
  • Converts WikiFormatting into GitLab Flavoured Markdown
  • Optionally generates a link back to the original Ticket in the GitLab issue

Known limitations

  • The ticket creation date is not migrated (all issues get current date as creation date)
  • There is no deduplication (running the script n times with the same parameters will create n copies of each issue)
  • The GitLab API token user must have access to the target GitLab project
  • Migrating the original author requires a GitLab API token from an administrator user. Even then, the original author must have access to the target GitLab project. If they don't, ticket will be migrated with the token user (administrator) set as as the ticket's author.
  • WikiFormating to GFM conversion does not cover every possible feature, but tries to cover the most common cases

Requirements

  • PHP >=5.3.0, with mbstring and json extensions
  • Trac with JSON-RPC plugin enabled
  • GitLab supporting web API v3

Usage

All configuration options are passed as arguments on the command line. To get an overview, just run the script without any parameters.

As a pre-compiled phar

curl -O http://apps.dachaz.net/trac-to-gitlab/bin/1.0.1/trac-to-gitlab.phar
php trac-to-gitlab.phar

On a UNIX-based system, you can also:

chmod +x trac-to-gitlab.phar
mv trac-to-gitlab.phar trac-to-gitlab
./trac-to-gitlab

From git

git clone https://github.com/Dachaz/trac-to-gitlab.git
composer install
php migrate.php

On a UNIX-based system, you can also:

chmod +x migrate.php
mv migrate.php migrate
./migrate

License

WTFPL

Additional notes

The idea has been adapted from https://gitlab.dyomedea.com/vdv/trac-to-gitlab/

Contributions welcome.

About

Command line utility to migrate Trac tickets to GitLab issues

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages