SVN-/Trac-Migration to Github in 2021

SVN-/Trac-Migration to Github in 2021We have a very complex and big trac-/svn-environment since we started coding our VoIP-One PBX. Trac was a great tool for such a long time and having so much data inside of it stopped us moving to the modern Git-/Github-Environment for a veeeery long time.

But now we did it and it really wasn’t that easy.

The reason is that we didn’t have to just migrate our SVN-Infrastructure but also all Wiki-Pages that document our code and also our Trac-Tickets where we managed our futher development.

After I had to deal with so many problems during the last days I try to collect all steps I have done and maybe it might help other people in the same situation.

There exist some complete solutions to migrate everything with one script but I had no luck with it in 2021. So here are my steps for migrating today.

SVN to Git Migration

First we download a small helper-file from Atlassian to generate a authors.txt file. In the authors.txt we describe which users in the svn-repository will be which users in the new git-repository.

Download the file here…


The authors.txt file could look like this = Foo Bar <>
2nd.user = 2nd User <>
3nd.user = 3rd User <>

No execute the following command for creating the authors.txt file automatically out of your existing SVN-Repository. After downloading edit the file and add the names based on your environment.

java -jar svn-migration-scripts.jar authors SVN_USERNAME SVN_PASSWORD > authors.txt

On Mac OSX Big Sur (and it seems this is valid for Catalina too) git-svn is no longer working. I found a solution here.

On Mac OSX BigSur I had to execute the following command for getting git svn running.

export PERL5LIB=/usr/local/lib/perl5/site_perl/5.28.2/darwin-thread-multi-2level

The following commands checkout the SVN-Repository as Git and do some format-changes for example for transforming SVN-Tags to real Git-Tags.

I got this list of commands from this page.

git svn clone --stdlayout --authors-file=authors.txt --no-metadata svnRepositoryAsGit
cd svnRepositoryAsGit
for t in $(git for-each-ref --format='%(refname:short)' refs/remotes/tags); do git tag ${t/tags\//} $t && git branch -D -r $t; done
for b in $(git for-each-ref --format='%(refname:short)' refs/remotes); do git branch $b refs/remotes/$b && git branch -D -r $b; done
for p in $(git for-each-ref --format='%(refname:short)' | grep @); do git branch -D $p; done

And finally let’s transmit the changes to Github.

git remote add origin
git push origin --all
git push origin --tag

Trac-Wiki to Github-Wiki Migration

Next login to your trac-server to do our wiki-migration. These steps are mainly based on the description of this page.

Run a trac-wiki-export

cd /usr/src
mkdir trac-wiki-dump
cd trac-wiki-dump/
trac-admin /home/trac/default/ wiki dump /usr/src/trac-wiki-dump/

Rename the Homepage and cleanup trac-specific junk

mv WikiStart Home
rm -f Wiki* Trac* CamelCase BadIP PageTemplates Inter* SandBox TitleIndex RecentChanges

Transform Trac-Wiki-Syntax to MediaWiki-Syntax which is used by Github.

Therefore we need a small helper-file which you can download here:

Enter the code into a new file in /usrc/src/

cd /usr/src/trac-wiki-dump
for f in *; do perl ../ $f; mv $f.after $; done

Remove old Trac-Footer from all wiki-files which conflicts with MediaWiki-Syntax

sed -i -- 's/{{TracNotice|{{PAGENAME}}}}//g' *

Clone the Wiki of your Github-Repository and add your new content.

cd /usr/src
git clone
git rm -f
cp /usr/src/trac-wiki-dump/*wiki .
git add *wiki
git commit
git push

Trac-Tickets to Github-Issues Migration

In our last step we want to transfer all Trac-Tickets and Roadmaps to Github Issues.

First we have to prepare trac and install xml-rpc plugin. Go to you trac home-directory and execute the following commands.

apt-get install python python-pip
cd /home/trac/default/
pip install svn+
trac-admin . config set components tracrpc.* enabled
trac-admin . permission add authenticated XML_RPC

Next we use a handy script again that does this migration-job for us.

cd /usr/src
git clone
cd migrate-trac-issues-to-github
pip install PyGithub
git config --global github.username myusername
git config --global github.password 
./ --trac-url= --github-api-url= --github-project=your-company/your-repository

Here on my side the script stopped again and again after about 50 requests because there seems to exist a request-limit on github. This is not a big deal. You can run the script again and again when it stops. It automatically recognizes where it stopped and continues with the next ticket.

Es wurden keine Ergebnisse gefunden, die Ihren Suchkriterien entsprechen.

Schreiben Sie einen Kommentar

Ihre E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.

Fill out this field
Fill out this field
Bitte geben Sie eine gültige E-Mail-Adresse ein.
You need to agree with the terms to proceed