Migrating from Subversion to Bazaar

Aug 1, 2009

There are a lot of options when moving from Subversion to a next-generation Version Control System, but Bazaar's ability to interact with a subversion repository can make the transition easy and painless. While it is possible to use the bzr command in a subversion checkout or use it to connect to a subversion repository, you sometimes want to completely move to Bazaar and stop using subversion at all. Here's how to do it.

First of all, I assume that you have your SVN repository on a server to which you have SSH access, and that you have bzr installed on that server as well. The action will be taking place on the server, so connect to it using your favorite SSH client, then enter the following command:

svnadmin dump -q path/to/my_svn_project > my_project_dump

This command exports all revision information stored in the my_project SVN repository into a file. The -q (quiet) option makes a difference if you connect to your server remotely (you don't want to stream the whole progress report through the standard output).

The second step is now to import this information into a bzr repository:

bzr svn-import my_project_dump new_path/to/my_project