Moving a Subversion Repository to Another Server
Moving a subversion repository from one server to another, while still preserving all your version history may seam like a daunting task, but fortunately it's not too difficult.
I recently had to move a subversion (svn) repository to another server. The repository was on a Windows server and had to be moved to a Linux server.
Step 1: Backup your old Repository
The first thing you need when moving from one server to another is a
dump of your subversion repository. Hopefully you are already creating dump's with a backup script, but if not here's how you can create a subversion dump file:
svnadmin dump /path/to/repository > repo_name.svn_dump
The dump file contains all the revisions you have ever made to your svn repository, so it will probably be quite large (it even includes files you may have deleted in a previous revision).
Step 2: Create the new Repository
Now, simply transfer the dump file on to your new subversion server, and create an empty repository:
svnadmin create /path/to/repository
Step 3: Import your old repository into the new one
Next import your dump file:
svnadmin load /path/to/repository < repo_name.svn_dump
You may want to force subversion to use the same UUID for the new repository as the old repository. To do this add
--force-uuid to your
svnadmin load command. In my case I wanted to do this. If you have already loaded your repository, there is a way to set the UUID at a later date, check the docs.
That's it, you now have a replica of your old repository on your new server.
What if someone committed a new revision to the old server during installation?
You can easily import the new revision, by creating an incremental dump on the old server:
svnadmin dump --incremental -r 1234 /path/to/repository > rev1234.svn_dump
Now to import that revision on your new server:
svnadmin load /path/to/repository < rev1234.svn_dump
Can't I just use a hotcopy to restore the repository?
It depends, hotcopies created with
svnadmin hotcopy must be moved to a server with identical setup. You should have the same version of subversion installed on both servers, same operating system, etc.
Subversion dumps are designed to work with different versions of subversion, and are just more flexible. Hotcopies are handy to have, but I recommend creating both hotcopies and dumps as part of your backup plan.
- Blocking .svn and .git Directories on Apache or IIS - October 15, 2013
- Ignore Files and Directories in Subversion - December 14, 2007
- Subversion Book for $2.99 - October 28, 2006
- Using svn over ssh - January 18, 2006
We keep 14 days of automatic SVN backup using hotcopy and tar. Today i moved from ubuntu 10.04 to Fedora Core 11 and restored the hotcopy exactly in the same location but different OS (of course), different SVN version. It worked without any problem.
Hotcopy doesn't give you verbose output but it's fast. So i use it more often than dump.
the network on a data server.
I want to move the Subversion server to a different SSH server. Is it
safe to install subversion on the new server and give it the path to the
already existing repositories on the data server?
Any advice would be great.
nice stuff... made my life much easier :-)
The apache and svn server versions were same in both the machine.
Can any one tell will it be create any issue in future
I am following these steps, but at the end when I goto http://localhost:3343/csvn/repo/list on new server, I do not see the imported project.
Don't know what is wrong... Probably doing some silly mistake. Could somebody help please?
On original server create backup file
(The console output is as follows)
C:\>svnadmin dump E:\svn\data\repositories\my_project_name > test_dump.svn_dump
* Dumped revision 0.
* Dumped revision 1.
* Dumped revision 2.
* Dumped revision 3.
On new server create new SVN repository
D:\>svnadmin create d:\NEWSVN
D:\>svnadmin load d:\NEWSVN < test_dump.svn_dump
<<< Started new transaction, based on original revision 1
* adding path : branches ... done.
* adding path : tags ... done.
* adding path : trunk ... done.
------- Committed revision 1 >>>
<<< Started new transaction, based on original revision 2
* adding path : my_project_name ... done.
------- Committed revision 2 >>>
<<< Started new transaction, based on original revision 3
* adding path : my_project_name/.classpath ... done.
* adding path : my_project_name/.project ... done.
* adding path : my_project_name/.settings ... done.
* adding path : my_project_name/.settings/org.eclipse.jdt.core.prefs ... done.
* adding path : my_project_name/src ... done.
------- Committed revision 3 >>>
- HackMyCF Adds SSL/TLS Scanner
- IncompatibleClassChangeError after ColdFusion 11 Update 5
- Scope Injection in CFML
- Upload Files Directly to Amazon S3 using ColdFusion
- Minor JavaDocs.org Update
- nginx Directive rewrite is not terminated
- Using Mozilla's Certificate Authority List for Java SSL
- SessionRotate solution for JEE Sessions