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. extracts and reformats all trac comments. saves ticket and extracted comments to a csv file.

Example of using these scripts:

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):


hello, world

Just to mark beginning of blog usage, here are my hello-s:


(while t
(message "Hello, all")
(message ""))


def hello_world_generator(msg):
for i in range(0, len(msg)):
yield msg[i]

if __name__ == '__main__':
for char in hello_world_generator('Hello, world'):
print char,

And of course, the C++

#include <string>
#include <algorithm>
#include <iterator>
#include <iostream>

using namespace std;

class hello_world_iterator : public iterator<forward_iterator_tag, char>
static const string msg;
string::const_iterator msg_i;
bool end_;
hello_world_iterator(bool end=false) : msg_i(msg.end()), end_(end) { }

char operator* () const
return (msg_i == msg.end()) ? '\0' : *msg_i;
hello_world_iterator& operator++ ()
if (msg_i == msg.end() && !end_)
msg_i = msg.begin();
if (msg_i == msg.end())
end_ = true;
return *this;

bool operator== (const hello_world_iterator &rhs) const
return msg_i == rhs.msg_i && end_ == rhs.end_;
bool operator!= (const hello_world_iterator &rhs) const
return !(*this == rhs);

const string hello_world_iterator::msg = "Hello, world";

int main(int argc, char* argv[])
copy(hello_world_iterator(), hello_world_iterator(true),
return 0;

(c++ version was written very fast, so sorry, it may contain some flaws).


Denis Dzyubenko shadone