Skip navigation.
Home

On manually migrating a subversion repository to Launchpad/BZR

I'd migrated one of my projects here (AWFFull ) from subversion to a bazaar repository hosted on Launchpad some time ago.

Works well, but were a few  niggles and tricks in the process.

  • all the code imported  as 'steve' - which is accurate Laughing but a little deflating to ones ego.
  • imported some of my earlier faffing around with subversion - again isn't a problem per-se, but would have been nice to clean it away.

So when it came time to migrating DNSHistory , I figured I'd have a go at fixing these niggles. Herein are the steps used.

  1. dump the subversion repository via svnadmin
  2. filter away the unwanted file; and cleanup the numbering via svndumpfilter
  3. script some awk to fix the appropriate fields in the now filtered dump file
  4. convert from an svn dump file to bzr
  5. push to launchpad

1. Dump

svnadmin dump -q /<PATH_TO_SVN_REPO>/dnshistory > dnshistory.dump

2. Filter

First identify the files to filter via egrep|sort

egrep '^Node-path.*tar\.gz' dnshistory.dump  | sort -u

Then use the FULL Node-path to filter: (ie: trunk/dnshistory-0.3.tar.gz)

svndumpfilter --drop-empty-revs --renumber-revs exclude \
trunk/dnshistory-0.3.tar.gz trunk/dnshistory-0.4.tar.gz \
< dnshistory.dump > dnshistory.filtered.dump

3.  'Fix' Smile

awk '{ if (f==2) { print "steve@emailz.zz.au"; f=0} else
if (f==1) { print "V 18" ; f=2; } else
if ($0 ~ /^svn:author/) { print $0; f=1; } else print $0}' \
dnshistory.filtered.dump > dnshistory.authored.dump

where 'V 18' is the length of the email address used in the first print statment; adjust that and email address accordingly.

4. Import

using Gustavo's svn2bzr program:

svn2bzr.py --scheme=trunk --exclude=branches --exclude=tags dnshistory.authored.dump DNSHistory_bzr

5.Push

to a junk branch for testing purposes. Proper branch once one knows all is cool.

bzr push lp:~spm/+junk/dnshisttest

You can see the end result here: https://code.launchpad.net/~spm/dnshistory/dnshistory-trunk

Enjoy!

 

Syndicate content