I'm just about wrapped up on a project where I was using a commercial SVN provider to store the source code. The web host the customer ultimately picked includes a repository as part of the hosting package, so, now that the project is over, I'd like to relocate the repository to their web host and discontinue the commercial account.
How would I go about doing this?
You can also use svnsync. This only requires read-only access on the source repository
more at svnbook
I found an article about how to move svn repositories from a hosting service to another, and how to do local backups:
Define where you will store your repositories:
svnadmin create $MYREPO
Create a hook file and make it executable:
Now we can start importing the repository with
svnsync
, that will initialize a destination repository for synchronization from another repository:And the finishing touch to transfer all pending revisions to the destination from the source with which it was initialized:
There now you have a local svn repository in the
~/repo
directory.Source:
The tool to do that would be
But for this to work, you need filesystem-access to the repository. And once you have that (and provided the repository is in FSFS format), you can just copy the repository to its new location (if it's in BDB format, dump/load is strongly recommended).
If you do not have filesystem access, you would have to ask your repository provider to provide the dump for you (and make them delete their repository - and hope they comply)
Basically, there are plenty of ways to accomplish the task. The topic is covered in depth in SVNBook | Migrating Repository Data Elsewhere, so I suggest reading the book's section.
Here is a brief description of your options:
It depends on your environment, but there is a great chance that you can simply copy the repository to the new server and it will work. You have to revise repository hook scripts after copying the repo to ensure that they are working as you expect.
You can use
svnadmin dump
andsvnadmin load
commands to, ehm, generate full dump and then load it to another repository on another server. You will need tosvnadmin create
a new clean repository to load the dump into it. Keep in mind that the approach deals with repository history only and does not move hook scripts and repository configuration files! As well, you must have read filesystem access to the original repository to dump it.Since Subversion 1.7,
svnrdump
tool is available. Generally speaking, it mimicssvnadmin dump
andsvnadmin load
functionality, but operates remotely. You are not required to have read / write filesystem access to original and target repositories as tool operates remotely like Subversion client, e.g. over HTTPS protocol. So you need to have read access to original repository and read / write to the target one.Another option is to use
svnadmin hotcopy
command. The command is mostly used for backup purpose, it creates full copy of the repository including configuration and hook scripts. You can move hotcopied repository to another server then.Excerpt from my Blog-Note-to-myself
Now you can import a dump file e.g. if you are migrating between machines / subversion versions. e.g. if I had created a dump file from the source repository and load it into the new repository as shown below.
rsvndump
worked great for me migrating a repository from svnrepository.com to an Ubuntu server that I control.How to install and use rsvndump on Ubuntu:
Install missing dependencies ("APR" and Subversion libraries)
Install rsvndump
Dump the remote SVN repository to a local file
Create a new repository and load in the local dump file