0

I will start by saying svndumpfilter failed (using this solution: Moving SVN repositories data with history as subfolders into another repository) I got the error:

At line:1 char:30
+ svndumpfilter include \trunk < E:\tmp\test1.dump > E:\tmp\test1filter.dump
+                              ~
The '<' operator is reserved for future use.
    + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : RedirectionNotSupported

after executing:

svndumpfilter include \trunk < E:\tmp\test1.dump > E:\tmp\test1filter.dump

My problem: I have a few projects as separate repositories as such:

RootDir -
     project1
     project2
     project3
     project4
     project5
     project6

3 of the projects are for the same company, so I want to move them like this:

RootDir -
     project1
     project2
     companyX -
         project3
         project5
         project6
     project4

i.e. I want to move multiple repositories to reside as subfolders in one main repository.

The repository is in a windows server 2012, and I use remote desktop to run svn command prompt on it.

I'm out of ideas

Clonimus
  • 5
  • 1
  • 8
  • The second command should be `svnadmin load`, not `svnadmin dump` – janos Aug 07 '14 at 17:01
  • This actually looks like you're moving projects around within the SAME repository, not moving projects from one repository to another, correct? If so, it's not a duplicate of the "Moving SVN repositories" question. – Ben Aug 07 '14 at 18:31
  • mistype, I actually did svnadmin load – Clonimus Aug 10 '14 at 07:02

3 Answers3

1
  • svnadmin can not dump only subtree from repository and can not use logical path to this subtree

svnadmin dump path_to_RootDir\project3 > temp_path_in_disk\dump_file.dmp

will dump the whole repository, from which you have to extract project(3|5|6) with svndumpfilter include into one common dump. But you can dump subtrees in one command with svnrdump dump URL and get 3 files without pre-filtering

  • If you load dump, you have to use svnadmin load command
  • On load, you have to use physical path to repository-root, not logical path inside repository:

svnadmin load path_to_RootDir < temp_path_in_disk\dump_file.dmp

  • If you want to change mount-point of data, restored from fump, you have to use --parent-dir option of load subcommand

svnadmin load --parent-dir companyX path_to_RootDir < temp_path_in_disk\dump_file.dmp

Lazy Badger
  • 94,711
  • 9
  • 78
  • 110
  • I tried " svnadmin dump https://my_site.com:8443/svn/test1/ > E:\tmp\test1.dmp" > e:/tmp/test.dmp I got this error: "svnadmin: E205000: 'my_site.com:8443/svn/test1/' is a URL when it should be a local path"×Comments may only be edited for 5 minutes×Comments may only be edited for 5 minutes×Comments may only be edited for 5 minutes – Clonimus Aug 10 '14 at 07:11
  • @Clonimus - dump and load work with **PHYSICAL PATH** to repository on *local filesystem*, not with URLs – Lazy Badger Aug 10 '14 at 12:22
  • I did `svnadmin dump E:\ServerFolders\Development\Repositories\test1 > E:\tmp\test1.dmp` and it worked, but: `svnadmin load E:\ServerFolders\Development\Repositories\test2 < E:\tmp\test1.dmp` gave me this error: `At line:1 char:63 + svnadmin load E:\ServerFolders\Development\Repositories\test2 < E:\tmp\test1.dmp + ~ The '<' operator is reserved for future use. + CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException + FullyQualifiedErrorId : RedirectionNotSupported` – Clonimus Aug 11 '14 at 09:03
  • @Clonimus - full dump, restored into existing repo (and if contents of repos are related) *may* have strange effects (if`test2` is fully functional per se) - never tried it. Try to filter dump (leave only needed folders) and|or load it with --parent-dir – Lazy Badger Aug 11 '14 at 23:16
  • @ Lazy Badger - thank you, what does it mean load it with parrent-dir? how does that work, I didn't quite understand from the docs. BTW test2 is an empty repository (only folder structure - trunk, tags & branch) – Clonimus Aug 12 '14 at 05:51
  • I think the problem is that original **project3** is a repository and **project3** in **companyX** (which is a repository) is just a folder inside a repository – Clonimus Aug 12 '14 at 07:18
  • @Clonimus - no, basename of repo means nothing in your case. `--parent-dir` is NEW mount-point of root for your dump: you dumped from root of repo, but want to to restore into another node (not root) – Lazy Badger Aug 12 '14 at 10:04
0

Note: this solves a different problem than intended by the question, which was actually asking about moving a set of repositories into subdirectories of a different repository.

It looks like you're moving projects around within the same repository, not moving between separate repositories. If this is the case, then I think you just want to use the svn mv command using two URL arguments. E.g. svn mv --parents http://example.com/RootDir/project3 http://example.com/RootDir/companyX/project3 -m "consolidate company X projects". The "--parents" option creates the intermediate directory if it does not exist.

Ben
  • 8,725
  • 1
  • 30
  • 48
  • Just for sake `svn mv --parents ...` – Lazy Badger Aug 07 '14 at 20:23
  • Thanks, adding to the answer. Some versions of the svn book don't include a link for that option :-) – Ben Aug 08 '14 at 00:04
  • I got this error "svn: E200007: Source and destination URLs appear not to point to the same repository." which is silly. I used as source: "my_site.com:8443/svn/test1/" and as destination: "my_site.com:8443/svn/tests/mytest1" In the first try the destination was not created (I was wondering if the mv command will create it) and on the second try I created it before executing – Clonimus Aug 10 '14 at 07:11
  • OK, that certainly looks like it may actually be two separate repositories then. You said in your question you had "a few projects in [your] repository" but it looks like actually you have a few repositories on your server. SVN mv will not work between repositories. – Ben Aug 11 '14 at 16:01
  • @Ben - So what will, in the simplest way? thank you for your answer – Clonimus Aug 12 '14 at 05:52
  • I think the problem is that original **project3** is a repository and **project3** in **companyX** (which is a repository) is just a folder inside a repository – Clonimus Aug 12 '14 at 07:19
  • Yes exactly. You should probably edit the question to make that clear. – Ben Aug 12 '14 at 14:34
0

The problem was i the Windows PowerShell of Windows Server 2012.

I downloaded Console 2 and used it instead of the Windows shell.

The solution suggested in "Moving SVN repositories data with history as subfolders into another repository" did the trick.

for my needs I didn't even need the svndumpfilter part.

Clonimus
  • 5
  • 1
  • 8