Importing trac tickets and wiki into BitBucket

This program is far from perfect, but seems to be good enough. It worked for me for trac 0.12.1 databases, so I can safely label it as works-for-me (tm).

This program's license is GPLv2.

Importing tickets

Tickets are read from the database and attachments, a zip file is created according to this format:

Then it can be imported directly from BitBucket management interface: Note that you'll loose all the previously existing issues.


For instance:

./ -o /tmp/ --tracdir /srv/trac/myproject

Importing wiki

Wiki with BitBucket is managed as a repository. Here, this program will replay all the Trac wiki history into this repository. For the moment, only mercurial is supported, but adding git support should be trivial.

You have to place your wiki repository working directory into the right state so that new commits will be added at the place you want. Most of the time, doing nothing is fine, but if you want to restart from an empty wiki, you may need to do something like this in your wiki repository:

cd /tmp/myproject-wiki
hg commit -m 'Close branch' --close-branch
hg update -C null


For instance:

hg clone ssh:// /tmp/myproject-wiki
./ -o /tmp/myproject-wiki --tracdir /srv/trac/myproject
cd /tmp/myproject-wiki
hg push