svn switch error - is not the same repository

Svn

Svn Problem Overview


I have recently moved the SVN server and now i am tring to relocate the working copies from my computer to the new server. But i get the strangest error. i do :

svn switch http://99.99.99.new/svn/company/project/trunk/web

but i get

svn: 'http://99.99.99.old/svn/company/project/trunk/web'
is not the same repository as
'http://99.99.99.new/svn/company/project'

the move was made with dump and import ... and the repo root is on http://99.99.99.new/svn/company/project

Do you guys have any ideas of what might be wrong ? thanks a lot

Svn Solutions


Solution 1 - Svn

Try using

svn switch --relocate http://99.99.99.old/svn/company/project/trunk/web http://99.99.99.new/svn/company/project/trunk/web

As noted by Sporino in the comments, since Subversion 1.7, there's a seperate relocate command:

svn relocate http://99.99.99.old/svn/company/project/trunk/web http://99.99.99.new/svn/company/project/trunk/web

Solution 2 - Svn

Also, in TortoiseSVN there is "Relocate" option, which you should use in situations like these (instead of the "Switch" option).

Solution 3 - Svn

My best way to do an SVN relocation is this:

svn switch --relocate $(svn info | grep ^URL | cut -f 2 --delim=' ') \
                      new_url_or_repository

In this way, using the right old url from the svn info command, you are sure to not enter a wrong one, which is one of the common erros.

If everything is correct, you will be prompted with the auth details for the new location, if they are different.

After issuing the command, be sure to double check that the change has been applied looking at the URL parameter, issuing

svn info

After relocating, update your working copy, to check that everything is ok:

svn update

My 2c ..

Solution 4 - Svn

Use the relocate command line parameter to the switch command.

http://svnbook.red-bean.com/en/1.1/re27.html">svn switch documentation

>Sometimes an administrator might change the "base location" of your repository — in other words, the contents of the repository doesn't change, but the main URL used to reach the root of the repository does. For example, the hostname may change, or the URL schema, or perhaps just the path which leads to the repository. Rather than checkout a new working copy, you can have the svn switch command "rewrite" the the beginnings of all the URLs in your working copy. Use the --relocate command to do the substitution. No file contents are changed, nor is the repository contacted. It's similar to running a perl script over your working copy .svn/ directories which runs s/OldRoot/NewRoot/.

Solution 5 - Svn

You need to use the --relocate option :

svn switch --relocate http://99.99.99.new/svn/company/project/trunk/web

see svnbook for more details.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionGabriel SolomonView Question on Stackoverflow
Solution 1 - SvnSteefView Answer on Stackoverflow
Solution 2 - SvnPascal LindelaufView Answer on Stackoverflow
Solution 3 - SvnGabrieleVView Answer on Stackoverflow
Solution 4 - SvncrashmstrView Answer on Stackoverflow
Solution 5 - SvnPeter ParkerView Answer on Stackoverflow