开发者

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 de开发者_JAVA技巧scription syntax to markdown and also export metadata like milestone information, but even a simple, working export is probably okay.


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


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.


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


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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜