0

We have an SVN Server with a folder structure as follows:

/svn/CompanyName/Trunk/Project

where company name is the project everything gets checked into, everything is in the trunk and each project has a folder... in some cases, we have projects which have a v2 or v3 after them... this was set up about 5 or 6 years ago and i kind of took it on last year...

part of my upgrade plan is to move stuff around so we have the following structure:

/svn/projectname/(trunk|tags|branches)/

the plan would be to take all files from the latest release of a project and place it into the trunk, and if there is a v2 or v1 of a project, put them in their own branch...

so far, i have figured out how to get svnadmin dump and svndump-filter working to get me a particular folder (so, svn/companyname/trunk/project1) and got 2 tests projects out (projectv1 and projectv2). now i need to tell project v1 to import into project/branch/v1 and tell project v2 to import into /project/trunk...

any ideas, other than messing directly with the dump file, on how to rename folders and keep the history?

TiernanO
  • 1,597
  • 14
  • 31
  • 1
    Have you considered doing server-side renames, rather than export / import? See http://svnbook.red-bean.com/en/1.1/re18.html – martin clayton Jun 26 '12 at 15:31
  • We may have to go down that route, but i just want to see if there is a better way of doing it... – TiernanO Jun 26 '12 at 15:32
  • Why do you think that your way is better? You are not trying to reduce the size of your repository, so what's the point of messing with svndumpfilter? – malenkiy_scot Jun 26 '12 at 15:54
  • i am actually changing the size of the repo... the current repo has about 30 or 40 projects. ideally, we would like to move current projects to a new repro on their own, so project1 would have its own repro, project2 would also, but if project3 has not been touched in years, leave it where it is... – TiernanO Jun 27 '12 at 10:49
  • The dump, filter (no-rename), load, svn move approach is probably the easiest but it can be a pain when 2 years later you are browsing the repository and you remember that you have to go back to revision xyz to see the previous structure and versions. Also seen issues in IDEs when you have an old branch that has since moved and you try to update to head. – vinnyjames Jun 27 '12 at 17:10
  • true, but give that technically speaking, these versions we are working on are not really branches, we dont have to worry about the second issue... also, based on my answer below, it seems that merging svn repos could be what i am looking for... – TiernanO Jun 28 '12 at 05:52

2 Answers2

2

According to the definitive SVN reference tweaking the dump file is the way to go:

At this point, you have to make a decision. Each of your dump files will create a valid repository, but will preserve the paths exactly as they were in the original repository. This means that even though you would have a repository solely for your calc project, that repository would still have a top-level directory named calc. If you want your trunk, tags, and branches directories to live in the root of your repository, you might wish to edit your dump files, tweaking the Node-path and Node-copyfrom-path headers so that they no longer have that first calc/ path component. Also, you'll want to remove the section of dump data that creates the calc directory.

malenkiy_scot
  • 16,415
  • 6
  • 64
  • 87
  • yup... thats looks like what i need to do alright... instead of /trunk/project i want to put files in project/trunk... now the big question... do i do this manually, or is there a magic tool i am missing? – TiernanO Jun 27 '12 at 14:36
0

looking around, based on the comment @malenkiy_scot made about editing the file, i found an article on the openSUSE lizards site about merging SVN Repositories. this seems to do what i need it to do, including the renaming of folders, merging of dump files, etc...

TiernanO
  • 1,597
  • 14
  • 31