0

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.

Lazy Badger
  • 94,711
  • 9
  • 78
  • 110
Matthew Housser
  • 1,012
  • 9
  • 21
  • 1
    Say repo1 and repo2 both have a revisionX. You can't have two separate revisionX's in one repo, so I don't think this can be done. Perhaps you could add repo1 as an [external](http://svnbook.red-bean.com/en/1.7/svn-book.html#svn.advanced.externals). – ThisSuitIsBlackNot Jul 24 '14 at 19:08
  • From (http://stackoverflow.com/questions/479361/can-i-move-an-existing-subversion-repository-into-a-new-parent-repository-and-r) I found this suggestion: `svnadmin dump http://oldrepo/ > mydump` `svnadmin load --parent-dir my/new/folder http://newrepo/ < mydump` ..with `--parent-dir` being the key. I'm tempted to try it. I wonder how this gets around the revision number conflict that you bring up? (For reference: our repo1 is at rev 24050. repo2 is much newer, say at rev 3000.) – Matthew Housser Jul 24 '14 at 19:21
  • possible duplicate of [How to migrate svn to another repository](http://stackoverflow.com/questions/939963/how-to-migrate-svn-to-another-repository) – ThisSuitIsBlackNot Jul 24 '14 at 19:32
  • Hmm, I guess it can be done, see the [docs](http://svnbook.red-bean.com/nightly/en/svn.reposadmin.maint.html#svn.reposadmin.maint.migrate). – ThisSuitIsBlackNot Jul 24 '14 at 19:33
  • 2
    Your question is answered here http://stackoverflow.com/questions/14795887/how-to-copy-svn-repository-as-a-folder-to-another-repository-with-history – Biswajit_86 Jul 25 '14 at 00:14
  • See edits. Cannot get this to work. Been trying for hours and hours. – Matthew Housser Jul 25 '14 at 00:21
  • @ThisSuitIsBlackNot - Certainly not a duplicate of that issue. It doesn't even mention loading into a subfolder... it speaks only of a simple repo-to-repo dump/load. – Matthew Housser Jul 25 '14 at 00:22
  • @MatthewHousser - RLLY? Did you try to read question and answer? – Lazy Badger Jul 25 '14 at 06:09
  • The question is covered in SVNBook and has been answered many times on StackOverflow, e.g. http://stackoverflow.com/a/11598608/761095 – bahrep Jul 25 '14 at 11:17
  • Did you create the `repo1` directory inside `repo2` before running `svnadmin load`? e.g. `svn mkdir file:///C:/Repositories/repo2/repo1` Note that you must create the directory using `svn mkdir` in order to add it to the repo. See the [documentation](http://svnbook.red-bean.com/nightly/en/svn.reposadmin.maint.html#svn.reposadmin.maint.migrate) for details. – ThisSuitIsBlackNot Jul 25 '14 at 14:41
  • I created `repo1` dir in `repo2` repo by committing the folder via TortoiseSVN. Should this not have been enough? – Matthew Housser Jul 25 '14 at 17:15
  • I'm following everyone's steps *exactly*, and I still cannot get past the error message. :( – Matthew Housser Jul 25 '14 at 17:44
  • @Biswajit_86 - yes, appears that it's answered there (I think), but yet I am blocked on the error message that I have updated in my original question. I've followed the steps exactly as stated, including adding the new /repo1 top-level directory in the repo2 repository. I did this using TortoiseSVN. – Matthew Housser Jul 25 '14 at 17:54

1 Answers1

0

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.

Matthew Housser
  • 1,012
  • 9
  • 21