Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to move an SVN repository to a new server

We would like to merge two of our servers together and in order to do that we would need to install SVN on the "new" server and then move over all of our repositories that we have set up on our "old" server.

Is this an easy operation to do? Possibly using the "Relocate" option that TortoiseSVN provides? What is the best way to do it?

Would this be a good time to re-organize how the repository is set up as well?

like image 553
Joe Phillips Avatar asked Sep 24 '10 17:09

Joe Phillips


People also ask

How do I export and import svn repository?

In the main menu, select VCS | Browse VCS Repository | Browse Subversion Repository to open the SVN Repositories tool window. Right-click a directory you want to export and choose Export from the context menu. In the Select Path dialog that opens, specify the destination directory and click OK.

How do I export my TortoiseSVN repository?

To export single files with TortoiseSVN, you have to use the repository browser (the section called “The Repository Browser”). Simply drag the file(s) you want to export from the repository browser to where you want them in the explorer, or use the context menu in the repository browser to export the files.

What is svn relocate?

The first svn relocate syntax allows you to update one or more working copies by what essentially amounts to a find-and-replace within the repository root URLs recorded in those working copies. Subversion will replace the initial substring FROM-PREFIX with the string TO-PREFIX in those URLs.


2 Answers

You can migrate a repository using the svnadmin dump function. On the SVN server, type svnadmin dump /absolute/path/to/the/repo > /tmp/repo.svndump. This will export the entire repository to a text file in the system's temporary directory and name it "repo.svndump". You might want to compress that file before transferring it to the new server.

Once you have the repo exported, you can then transfer the dump file to the new server and import it like so: svnadmin load /absolute/path/to/the/**new**/repo < repo.svndump.

See 'svnadmin dump' and 'svnadmin load' for more information.

After dumping the repository and loading it on the new server you would use the --relocate command to switch your local copy to the new server.

Caution: If your repositories use any externals then you will have some problems. See my question on Server Fault for details about this.

like image 185
James Sumners Avatar answered Sep 20 '22 09:09

James Sumners


If the new server uses the same operating system you can just copy the entire repository folder to the new server. No need to dump and reload it.

The relocate command allows you to point your working copy to the new server i.e. it does not help you to move the repository, it just saves you from doing a fresh checkout.

Externals can be a problem but do not have to be. If the external repository was on the same server then you probably specified the external with a relative URL. If the new server uses the same structure then everything should work just fine.

like image 22
Stefan Egli Avatar answered Sep 21 '22 09:09

Stefan Egli