1. First, dump the repository to some file
svnadmin dump /path/to/repo > dumpfile.txt2. Move your repository folder to somewhere else in order to backup, just in case
mv /path/to/repo /path/to/repo_backup3. Now, manually change the "Node-path:" and "Copy-to-path:" headers to insert "trunk/" into them
sed -e 's/^\(Node-path: \)\(.*\)/\1trunk\/\2/;s/^\(Copy-from-path:\)\(.*\)/\1trunk\/\2/' dumpfile > dumpfile.newIf you find above command too hard, just open the dumpfile in any text editor and do find and replace. :-) You should be replacing "Node-path:" with "Node-path:trunk/" and "Copy-to-path:" with "Copy-to-path:trunk/". Simple huh! 4. Create new repository
svnadmin create /path/to/repo5. Load modified dump file into newly created repository
svnadmin load newdumpfile.txt path/to/repo6. Finally, import 'tags' and 'branches' folder in the repository. Now, you will see your repository with proper structure in which you can make branches and tags of your project.
Actually it would be easier to create these 3 directories inside the repo simply by checking them in on the top level (I even have 3 empty directories on my HD as a template for new repos), them moving the whole stuff from / to /trunk. It is more safe than fiddling with a dump file. Even with a backup on my hands, I would not like to do this in such a way. And the benefit is, the availability is not interrupted
ReplyDelete