How to change root directory of a SVN repository to trunk without moving all files?

5,013

You can use svn mv ... to do the move. This will preserve file history.

But your devs may need to checkout again, as such a big change in directory layout is likely causing trouble with IDEs and other important things.

Share:
5,013
2ndkauboy
Author by

2ndkauboy

Updated on September 18, 2022

Comments

  • 2ndkauboy
    2ndkauboy over 1 year

    Ok, here is my issue. I created a repository long time ago when I was not familiar with administrating a subversion server. I knew that it would be a good idea to have a "trunk" folder to work in. So I created a folder like /home/svn/project/trunk but instead of creating the repository in /home/svn/project I created it in /home/svn/project/trunk and worked in that folder from that time on.

    Now we have almost 1000 revisions in that wrong folder but we want to have a branches folder. So what can we do? The best would probably be moving all files into the /home/svn/project folder and that have then moved into the trunk folder. But I think that this will result in a delete and add action on all files and folders which will pretty much ruin the whole history and make a revert to a previous revision impossible.

    Is there any chance of moving the files? Or is there at least the possibility to create a branches folder and use this folder?

    • Turbo J
      Turbo J almost 13 years
      It is unclear whether your /home/svn/project is a Repository or a Working Copy. Please clarify.
    • 2ndkauboy
      2ndkauboy almost 13 years
      My /home/svn/project/trunk is a repository. It should be /home/svn/project so that is the issue I wanted to solve.
  • 2ndkauboy
    2ndkauboy almost 13 years
    I don't know how the command should be. Can you please give me a full example. Let's assume I want to move it from /home/svn/project to /home/svn/project/trunk what would the command be? Or do I have to move it to a folder outside the repository and within another repository like /home/svn/new_project/trunk. All of my command I tried failed.
  • 2ndkauboy
    2ndkauboy almost 13 years
    It was very complicated but in the end it worked out. I've created the trunk folder inside the working copy and commited that new folder. Than I had to do a svn mv PER FILE AND FOLDER as the trunk cannot be moved into itself. Afterwards I commited the move actions. Than I was able to move the repository files from the fake trunk folder to its parent. That gave me the option to not change any setting on the clients as the still pointed to a trunk folder which was now a real repository directory.