Can I switch SVN repositories from Eclipse?

EclipseSvn

Eclipse Problem Overview


I am moving my Subversion repository from one machine to another. I have a few scattered working copies on various machines, and I have found that I can easily switch the working copies from the old server to the new one with the following command:

svn --relocate svn://oldServer/repo svn://newServer/repo

However, on one of my machines, I use Eclipse with Subclipse, and I don't like to use command-line SVN on my Eclipse projects. My question is whether it is possible to switch SVN repositories from within Eclipse using either Subclipse or Subversive.

Eclipse Solutions


Solution 1 - Eclipse

I think you need to go into your 'repository browser' perspective there you right click your current repository and 'relocate' it to another domain.

Solution 2 - Eclipse

Do not use the "Team/switch" option, but rather change to the "SVN repository exploring" perspective and change the URL location there in the location properties of your repository. Works like a charm on Indigo - using Subversive in my case.

When using Subversive this will show a warning "The attached projects will be relocated because the repository root URL differs from the previously entered one", which is just what you want. Be sure to open all projects you want relocated before doing this.

When getting "Cannot relocate the connected projects" with "Relocation cannot be performed because the new URL refers to the different repository" then maybe your repository root has no trunk/tags/branches folders, or has such folders in subfolders as well. Then on the tabsheet Advanced, disabling the option Enable Structure Detection might help.

If you get "Relocation cannot be performed because the new URL refers to the repository which is not valid (incorrect URL or credentials specified)" then also make sure the root path within the new repository URL matches the root of the old URL. (In other words: ensure that /new/path in the screenshot above has the same subfolders as the old URL.)

Solution 3 - Eclipse

Just right click on the project-> team -> disconnect.

Then another right click on the project -> team -> share -> to your new SVN.

That's it!

Solution 4 - Eclipse

Within Eclipse Navigator, if you right-click the project name a submenu will appear. On that sub-menu select Team which will provide some addtional menu options. Select the "Swich to another Branch/Tag/Revision ..." and a window will appear allowing you to specify the new branch or in your case a new repository location.

Solution 5 - Eclipse

You can do the following:

Go to project explorer view -> right click on your project -> team -> switch ... and now select the new URL.

Thats all!

Solution 6 - Eclipse

I could not relocate from my eclipse. I have different projects on different branches and tags (read-only it’s only for comparing different versions) of the same repository. When the ip of our svn server changed, I could relocate through TortoiseSVN but not from Subclipse.

Changing from http://oldserver/svn/PROJECTNAME to http://newserver/svn/PROJECTNAME I get :

org.apache.subversion.javahl.CientException: Invalid operation on the current working directory
svn: Cannot relocate 'E:\…\workspaces\PROJECTNAME\tags\modulename\2.4.007\base' as it is not the root of a working copy; try relocating 'E:\…\workspaces\PROJECTNAME\tags\modulename\2.4.007' instead

Ok but I don’t have the control over this. I ended with a workaround involving my hosts file.

Solution 7 - Eclipse

In Eclipse, go to Window -> Perspective -> Open Perspective -> Other -> SVN Repository Exploring. Click Ok

Then right click on the repository you want to change -> Location Properties.

Change the url click finish.

That's it!

Solution 8 - Eclipse

You may be able to just swap the server names in DNS; this might be easier than switching all the working copies.

Solution 9 - Eclipse

team -> disconnect

and

team -> share -> to your new SVN

This is better solution than switch.

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
QuestionBrandon YarbroughView Question on Stackoverflow
Solution 1 - EclipseLukeView Answer on Stackoverflow
Solution 2 - EclipseStefan HaberlView Answer on Stackoverflow
Solution 3 - EclipsegerardclView Answer on Stackoverflow
Solution 4 - Eclipsestan rileyView Answer on Stackoverflow
Solution 5 - EclipseNicolas FinelliView Answer on Stackoverflow
Solution 6 - EclipseboumbhView Answer on Stackoverflow
Solution 7 - EclipseSaqib AhmedView Answer on Stackoverflow
Solution 8 - EclipseRobin GreenView Answer on Stackoverflow
Solution 9 - EclipseChoiView Answer on Stackoverflow