Search code examples
svnsvnadmin

Copy SVN repository into subfolder of another server's repository, with history


SVN repo 1: https://local.server.001/svn/repo1

SVN repo 2: https://local.server.002/svn/repo2

We want to move repo1 (from server 001) into a subfolder of repo2, called (for example) 'repo1'.

This is to say, repo1 will be copied into this location:

https://local.server.002/svn/repo2/trunk/repo1

Doing this with simple file copies is simple. What I'm trying to do, however, is to achieve this while preserving the history of the files being copied into the repo1 folder of the repo2 repository.

I have found plenty of examples of copying between repositories - or between repositories on different servers - but I'm having trouble finding examples of this specific type of situation.

Please help! Thanks.

We're all TortoiseSVN users, so any answer which uses the TorsoiseSVN GUI would be a plus. Our SVN servers run on VisualSVN.

EDIT - Adding beautiful illustration:

SVN repo into another repo's folder

EDIT 2 - Still can't get it to work:

Ran this on repo 1: sysadmin dump C:\Repositories\repo1 > D:\dump\repo1

This worked. Copied the repo1 dump file onto server 2. I then ran:

svnadmin load --parent-dir repo1 C:\Repositories\repo2 < D:\someDir\repo1

I'm blocked on this error:

Started new transaction, based on original revision 1. adding path : repo1/trunk ...svnadmin: E160013: File not found: transaction '281-96', path '/repo1/trunk'

I tried committing a top-level folder repo1 into the repo2 repository, but no luck.


Solution

  • Aha. It seems that the difference between my case and the other similar cases on S/O is that my repositories use the default /branch /tags /trunk structure.

    The eventual sequence for me was:

    svnadmin dump C:/Repositories/repo1 > D:/dump/repo1.dump

    svndumpfilter include /trunk < D:/dump/repo1.dump > D:/dump/repo1.filtered.dump

    I then created (via TortoiseSVN) a top-level repo1 folder inside the repo2 repository.

    This next line failed for me, despite it following all the suggested examples:

    svnadmin load --parent-dir /repo1 C:/Repositories/repo2 < D:/dump/repo1.filtered.dump

    No good. Didn't work. Error of the type Started new transaction, based on original revision 1. adding path : repo1/trunk ...svnadmin: E160013: File not found: transaction '281-96', path '/repo1/trunk' kept being returned. This is where I got stuck. I even created the repo1 folder, so why this message!!

    ..Well, it's because of the branches/tags/trunk folder structure that is VisualSVN's default. Once I changed the load statement to include /trunk before the repo1 folder, it all worked:

    svnadmin load --parent-dir /trunk/repo1 C:/Repositories/repo2 < D:/dump/repo1.filtered.dump

    It was looking for a /repo1 folder at the highest level, that is to say, living next to tags, branches and trunk.

    (After this, I had to do an SVN move to move everything from /trunk/repo1/trunk/* to /trunk/repo1. Seems the dump/load re-created the 'trunk' folder, which I didn't want.