Friday, October 27, 2006

Trac to Jira migration

Some days ago I spent few hours to migrate our corporate issue tracking system from Trac to Jira. For this task I've written some scripts that automate the migration process.

Just to remember, in case I will need them again some day, I publish them here ... on Google Code. Will see if Google Code is comparable enough with sourceforge to use.

comments.py extracts and reformats all trac comments.

export.py saves ticket and extracted comments to a csv file.

Example of using these scripts: trac2jira.sh

Jira import configuration: jira.config


And the script to update subversion commit messages. It simply replaces links to Trac tickets (ex: #1) to Jira-style issue links (ex: COR-1): repo_update.sh

10 comments:

v12aml said...

А на чем эта Jira написана?

shadone said...

лучше поздно чем никогда.

jira полностью на java - соответственно что в linux что в windows работает одинаково.
отличная вещь, но дорогая (если это останавливает).

(а что, blogger не уведомляет о новых комментариях??)

Nihilist said...

For some reason the files that come out of Google Code are in DOS format. Strange.

shadone said...

nihilist, I am not sure how this have happened, but fixed it in svn.

Juan said...

Thank you Denis. Your script was really handy to me. I only had to adapt it to PostgreSQL but it was straightforward.

Gert Wohlgemuth said...

thank you very much for this handy script. It worked perfect for our testing.

But coudl you provide some docu in future?

like copy the trac.db file fromy our trac isntalliation in your current directory? It was one of the "doooh" moments tonight :)

Nicholas Yue said...

Why does it think it is not a database or that it is encrypted

I had the following errors:

$ python ./comments.py
Traceback (most recent call last):
File "./comments.py", line 5, in module
con = sqlite.connect('trac.db', encoding='utf-8')
File "/usr/lib/python2.5/site-packages/sqlite/__init__.py", line 61, in connect
return Connection(*args, **kwargs)
File "/usr/lib/python2.5/site-packages/sqlite/main.py", line 445, in __init__
self.db = _sqlite.connect(database, mode)
_sqlite.DatabaseError: file is encrypted or is not a database

Denis Dzyubenko said...

what's the version of python/sqlite module? it looks like it isn't the same as Trac use.

Just try to open the database from a command-line with sqlite version 2 (sqlite trac.db) and 3 (sqlite3 trac.db) to check which one is required and ensure you use the right python-sqlite module.

Vadim said...

Does anyone know how to export attachments from TeamTrack to JIRA?

Pradeep Pamidipalli said...

Hi Denis,

Good to see a useful topic. I am in a process of migrating from Trac to Jira. We are currently using the following configuration:

- Trac: 0.11.7
- DB: postgreSQL 9.2.1

Are there scripts to import data from Trac with PostgreSQl to Jira?

We are using the same postgreSQL DB for Jira too.

Please help.

Thanks,
Pradeep

Denis Dzyubenko shadone