3

I have created a repository named as allProjects in server. Below is the allProjects structure:

allProjects

  • Projects
    • projectA
    • projectB
    • projectC
    • projectD
    • projectE

Now I am trying to create another repository named as requiredProjects which includes specific projects from allProjects.

Expected requiredProjects structure is:

requiredProjects

  • projectB
  • projectD
  • projectE

I also want to create requiredProjects repository with all access controls and history exactly similar to allProjects.

I have been searching a lot on this topic however I'm unable to find any solution.

Any help would be greatly appreciated.

Gangadhar Jannu
  • 4,136
  • 6
  • 29
  • 49
  • Can you clarify what you are trying to achieve with the `reqProj` repository? The first option would be that `reqProj` would be a subset of projects in `allProj` but any changes in one would be reflected in the other. The second option would be that `reqProj` would be a fork of a subset of projects in `allProj`, so the history up to the point in time when the projects have been forked would be shared, but thereafter would diverge. – Umar Farooq Khawaja Feb 03 '15 at 12:48
  • I'm trying to achieve second option. Simply I want to make 'reqProj' a backup server for 'allproj' with required 17 projects. So 'allProj' contains 17 projects from 'reqProj' with all revisions and history – Gangadhar Jannu Feb 04 '15 at 05:30
  • Can you stop the Subversion server process to gain exclusive access to the Subversion folder representing `allProj`? Also, I must stress that the histories for `allProj` and `reqProj` will diverge from this point onward. – Umar Farooq Khawaja Feb 04 '15 at 13:57
  • I can stop svnserve process but I want history also. – Gangadhar Jannu Feb 04 '15 at 15:28
  • That's why I'm struggling a lot. If I don't want history I can simply export and import projects... – Gangadhar Jannu Feb 04 '15 at 15:29
  • By diverge, I mean that they will be the same up to the point when you take the action, but after you've taken the action, they will not be the same in future. Imagine that you are driving down the road, you come to a split in the road. There is a path on your right, and another on your left. If you take one, you will no longer be on the other path. The second option I offered is like that. You will retain history up to the point where you perform the action, but once you have performed the action, any change in one won't be reflected in the other. Is this what you want? – Umar Farooq Khawaja Feb 04 '15 at 16:21
  • yes that's what I want. After creating 'reqProj' repository we no longer need 'allProj' repository. – Gangadhar Jannu Feb 05 '15 at 05:21

2 Answers2

3

Read about SVN externals, if you want to have single point of history for shared objects or svnadmin dump + svndumpfilter + svnadmin load in case of physical replication of subtree

As result of fastest search I found:

and, if you'll have hard times with errors "Missing node" in ordinary svndumpfilter command

svndumpfilter include Projects/projectB Projects/projectD Projects/projectE > filtereddump.dmp

you have to have, understand and use "Ultima ratio regum": Svndumpsanitizer

Lazy Badger
  • 94,711
  • 9
  • 78
  • 110
  • Thanks for your answer. I've googled a lot still I'm unable to find any solution. In blogs everyone is displaying "how to move single project to another svn repository" – Gangadhar Jannu Feb 01 '15 at 12:17
2

Please bear in mind that I haven't used Subversion since Jun 2010 (back when I wrote that answer) but from memory, something like the following will get you a cloned copy of allProj called reqProj.

The following steps have to be executed on the server hosting the Subversion repository.

It assumes that on the machine that hosts your Subversion repositories, the repositories exist on X:\Repositories and the URL to the Subversion server is http://localhost:8080 and the one is in the working folder.

Step 1

  • svnadmin create X:\Repositories\reqProj
  • svnadmin dump X:\Repositories\allProj > allProj.dmp
  • svnadmin load X:\Repositories\reqProj < allproj.dmp
  • svn checkout http://localhost:8080/svn/reqProj reqProj

I would use the Repository Browser available through TortoiseSVN to perform the following steps.

Step 2

Next, delete the project folders you don't need, such as projectA and projectC. Finally, you can move projectB, projectD, and projectE to the top level and get rid of the Projects folder as well.

You will end up with some extraneous history (describing the deletions and folder moves), but that's okay, I guess? :)

I hope this helps you out.

Community
  • 1
  • 1
Umar Farooq Khawaja
  • 3,925
  • 1
  • 31
  • 52
  • Thanks for your answer. However I've tried this approach also. After this approach I will end up with a 'reqProj' repository which contains 17 projects. So I'm planning to make another mirror repo for this 'reqProj' repository. When I tried to make mirror repo again it is copying all the projects that means mirror repository contains all the projects in 'allProj' – Gangadhar Jannu Feb 05 '15 at 12:18
  • Yes. That's right, that is the first stage. In the next stage, you delete the projects not required in the new repository, which would leave you with a slimmed-down repository. I will mark the 2 stages more clearly in my answer to highlight this 2-step process. – Umar Farooq Khawaja Feb 05 '15 at 14:29
  • Actually the repository size is huge (around 100GB) so again creating mirror repository with 100GB is tedious job and it takes so much time. That's why I want to create a repository which contains required projects so that I will be able to create another readonly mirror repository for required projects – Gangadhar Jannu Feb 05 '15 at 18:03
  • Any way thanks for your answers and comments. You helped me a lot – Gangadhar Jannu Feb 05 '15 at 18:04
  • It was my pleasure. I will try to do some more research to see if some of the history can be stripped out to get a subject of the projects into `reqProj`. If I find something, I will update my answer. Good luck. – Umar Farooq Khawaja Feb 06 '15 at 16:14