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.
Tickets are read from the database and attachments, a zip file is created according to this format: https://confluence.atlassian.com/pages/viewpage.action?pageId=330796872
Then it can be imported directly from BitBucket management interface: https://confluence.atlassian.com/display/BITBUCKET/Export+or+import+issue+data Note that you'll loose all the previously existing issues.
./tickets.py -o /tmp/myissues.zip --tracdir /srv/trac/myproject
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
hg clone ssh://email@example.com/myuser/myproject/wiki /tmp/myproject-wiki ./wiki.py -o /tmp/myproject-wiki --tracdir /srv/trac/myproject cd /tmp/myproject-wiki hg push