3
votes

My current repository is : /var/www/svn/project.all my files within project folder.it doesn't have trunk,branches,tags structure as of now. Now i have created new project as "/var/www/svn/projectnew" with trunk,branches,tags. I took the Dump of "/var/www/svn/project" and loaded to "/var/www/svn/projectnew/trunck" and created one branch in "/var/www/svn/projectnew/branches/site1" from trunk.

Currently my Working copy pointing "/var/www/svn/project". i tried to switch my working copy from "/var/www/svn/project" to "/var/www/svn/projectnew/branches/site1" but it saying,

Repository UUID 'd3f06af7-c344-2d45-b1bd-7799e0e99d7a' doesn't match expected UID 'f5f9f6ac-3f50-7e4d-a9d4-0bc9a9b443b8'.

Help me on how i can go with this?

2
How did you tool Dump of project? If you just did copy paste then your repository is going to point old project. You need to first remove SVN binding and to do that you need to export code, if your are using Tortoise SVN then it's quite easy.pramodtech
I used below command for do this, $ svnadmin dump /var/www/svn/project > project.dump , $ svnadmin load /var/www/svn/projectnew/trunck --parent-dir trunk < project.dump. Is there anything wrong in this? please advice.user1536854

2 Answers

8
votes

ORIGINAL REPLY:

There are two things you can do here - one is to copy the file db/uuid from the old server to the new one if you're just transferring the svn repository to a new machine and you plan to turn off the old one. The other thing depends on the SVN version you're using. If you're using 1.7 then use svn relocate (see docs), or for older clients use the --relocate option of the svn switch command which is intended for this scenario.

EDIT:

I misunderstood -- you want to recreate your repository with the trunk/branches/tags structure. In that case, dumping and reloading the project won't help as it won't magically create the new structure -- it'll just recreate what you already have. You can though easily create the new structure either in the repository browser (if you're using TortoiseSVN) or directly from your working copy. If you're doing it from the command line the syntax will be something like this, depending on the exact directory structure. Replace http:.../ with the address of your svn server. Oh, and back up the repository first!

# check out top-level directory
svn co http://.../
# make new trunk dir and move all contents to it -- note spelling of 'trunk'
mkdir trunk
svn add trunk
svn mv * trunk

# now create tags and branches
mkdir tags
mkdir branches
svn add trunk tags branches

svn commit -m "Created new repository layout"

Now all you should need to do to switch existing working copies over is:

svn switch http://.../project  http://.../trunk/project
0
votes

One more way is to keep history as it is and switch to the new structure starting from a new revision. In this case you will not need dump/load manipulations with repository.

  1. "svn delete" everything from repository root
  2. create trunk/branches/tags structure
  3. "svn copy" repository content from revision before deleting to trunk