jterrace
jterrace

Reputation: 67063

How to export Trac to Github Issues

We use Trac for an open-source project I'm working on. I'd like to export all of our open tickets to Github's Issues. I've found a couple small scripts that might do it, but I was wondering if anyone has done this and has suggestions.

Ideally, it would convert trac's description syntax to markdown and also export metadata like milestone information, but even a simple, working export is probably okay.

Upvotes: 24

Views: 5906

Answers (5)

Chris Adams
Chris Adams

Reputation: 5021

I recently needed to do this without having direct database access for the Trac server and wrote a Python script which uses Trac's XML-RPC interface:

https://github.com/acdha/migrate-trac-issues-to-github

It makes some attempts to preserve user assignments, convert Trac markup in the ticket description and comments, migrate commit links, rewrite ticket references to the corresponding Github issue numbers, and preserve the original Trac data for searches.

Upvotes: 1

mavam
mavam

Reputation: 12552

I've also written a small utility trac-hub that does the job: http://mavam.github.io/trac-hub.

It uses octokit to access github's API and sequel to interface to trac's database. As a result, it's fairly easy to adapt to your trac installation.

Upvotes: 1

yegor256
yegor256

Reputation: 105043

You can try my trac2github PHP script, which moves only tickets, trying to preserve formatting and order of comments.

Upvotes: 2

roskakori
roskakori

Reputation: 3336

I exported ticket details to a CSV file using a Trac query and converted them to Github issues using PyGithub. You can find the Python script and Trac query at http://pypi.python.org/pypi/tratihubis/.

The advantage of the CSV approach is that you do not need direct access to the database and it works with any database because all you need is a Trac query. Furthermore you can manually cleanup the CSV before import and e.g. remove tickets you do not want to convert to issues.

Thanks to PyGithub, all this works with Github API v3. API v2 has been deprecated, so some older scripts doing the same might not work anymore.

Upvotes: 3

Ewen Cheslack-Postava
Ewen Cheslack-Postava

Reputation: 1431

https://github.com/trustmaster/trac2github looks like it might work well, covering milestones, tickets, comments, converting usernames and setting assignees.

Upvotes: 14

Related Questions