This post gives you the Windoze commands because this was something I worked on for my Office.
We have a project. Let’s call it project1. When the repo for the project was initially created it was not created with branches, trunk, and tags folders in the root. Going forward, everything was just committed to the root instead of to the trunk folder. Well, now we want to follow best practices and begin committing to the trunk. We don’t want to lose any of our repo history in the process though if we have to do re-creations of the repo.
We tried to do an svn mv, but you can’t move a repo to a path within the repo. So here’s what we did.
- Make a dump of the current repo
svnadmin dump c:\Repositories\myproject1\ > c:\myproject1.dump
- Delete the current repo (I’m assuming you have a backup if something goes wrong. You do, don’t you?).
- Recreate the repo. This time let’s be sure to make branches, trunk, and tags folders in the root.
svnadmin create c:\Repositories\myproject1
svn mkdir trunk
svn mkdir branches
svn mkdir tags
- Load the dump into the trunk (Gross):
svnadmin load c:\Repositories\myproject1\ --parent-dir trunk < c:\myproject1.dump
There it is.
You might also give this a try: http://chipcastle.blogspot.com/2008/08/subversion-forgot-to-create-trunk.html