Migrate svn from Assembla to Atlassian
Question
I'm trying to migrate my subversion repo to Atlassian. Atlassian requires the imported repo dump to have a root directory with the same name as the project per project key. Let's say my project key in Atlassian is FOOBAR, then the repo dump should contain /FOOBAR for all revisions. It should also contain trunk, branches and tags subdirectories.
To rewrite the Assembla svn dump, I did this:
cat foobar-assembla.dump | svn-dump-reloc "/" "FOOBAR" > foobar-atlassian.dump
Then I tried testing it:
svnadmin create test
cat foobar-atlassian.dump | svnadmin load test
That produced an error message:
svnadmin: File not found: transaction '0-0', path 'FOOBAR/trunk'
* adding path : FOOBAR/trunk ...
Any ideas?
Solution 2
The following worked for me.
Using a text editor with all conversion options turned off:
- Replace all instances of
Node-path: trunk
withNode-path: FOOBAR/trunk
. - In the revision in which
FOOBAR/trunk
is created, manually add an entry immediately before the one that addsFOOBAR/trunk
that createsFOOBAR
,FOOBAR/branches
andFOOBAR/tags
.
I understand this may not work in some cases, such as when Node-path: trunk
occurs within a file itself. But it worked in this case and should work in most others.
OTHER TIPS
I think this is because the dump file does not contain any transaction that would create the FOOBAR directory itself.
Try running svn mkdir file://$PWD/test/FOOBAR
just before the svnadmin load test
.
To give credit where it's due, I got this tip from http://dotslashstar.blogspot.com.au/2011/06/svn-hack-insert-missing-trunk-root.html