<p>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.</p>

<p>How would I go about doing this?</p>

[{'answer_id': 49459, 'author': 'Dan Dyer', 'author_id': 5171, 'author_profile': 'https://Stackoverflow.com/users/5171', 'pm_score': 2, 'selected': False, 'text': '<p>Assuming you have the necessary privileges to run svnadmin, you need to use the <a href="http://svnbook.red-bean.com/en/1.4/svn.ref.svnadmin.c.dump.html" rel="nofollow noreferrer">dump</a> and <a href="http://svnbook.red-bean.com/en/1.4/svn.ref.svnadmin.c.load.html" rel="nofollow noreferrer">load</a> commands.</p>\n'}, {'answer_id': 49468, 'author': 'pilif', 'author_id': 5083, 'author_profile': 'https://Stackoverflow.com/users/5083', 'pm_score': 3, 'selected': False, 'text': "<p>The tool to do that would be </p>\n\n<pre><code>svnadmin dump\n</code></pre>\n\n<p>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).</p>\n\n<p>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)</p>\n"}, {'answer_id': 49470, 'author': 'erlando', 'author_id': 4192, 'author_profile': 'https://Stackoverflow.com/users/4192', 'pm_score': 2, 'selected': False, 'text': '<p>You might find some help on migrating SVN repositories in <em><a href="http://svnbook.red-bean.com/en/1.0/ch05s03.html#svn-ch-5-sect-3.5" rel="nofollow noreferrer">Chapter 5. Repository Administration, Migrating a repository</a></em>.</p>\n\n<p>This approach requires access to svnadmin.</p>\n'}, {'answer_id': 49483, 'author': 'Tadmas', 'author_id': 3750, 'author_profile': 'https://Stackoverflow.com/users/3750', 'pm_score': 7, 'selected': True, 'text': '<p>If you want to move the repository and keep history, you\'ll probably need filesystem access on both hosts.  The simplest solution, if your backend is FSFS (the default on recent versions), is to make a filesystem copy of the entire repository folder.</p>\n\n<p>If you have a Berkley DB backend, if you\'re not sure of what your backend is, or if you\'re changing SVN version numbers, you\'re going to want to use svnadmin to dump your old repository and load it into your new repository.  Using <code>svnadmin dump</code> will give you a single file backup that you can copy to the new system.  Then you can create the new (empty) repository and use <code>svnadmin load</code>, which will essentially replay all the commits along with its metadata (author, timestamp, etc).</p>\n\n<p>You can read more about the dump/load process here:</p>\n\n<p><a href="http://svnbook.red-bean.com/en/1.8/svn.reposadmin.maint.html#svn.reposadmin.maint.migrate" rel="noreferrer">http://svnbook.red-bean.com/en/1.8/svn.reposadmin.maint.html#svn.reposadmin.maint.migrate</a></p>\n\n<p>Also, if you do <code>svnadmin load</code>, make sure you use the <code>--force-uuid</code> option, or otherwise people are going to have problems switching to the new repository.  Subversion uses a UUID to identify the repository internally, and it won\'t let you switch a working copy to a different repository.</p>\n\n<p>If you don\'t have filesystem access, there may be other third party options out there (or you can write something) to help you migrate: essentially you\'d have to use the svn log to replay each revision on the new repository, and then fix up the metadata afterwards.  You\'ll need the pre-revprop-change and post-revprop-change hook scripts in place to do this, which sort of assumes filesystem access, so YMMV.  Or, if you don\'t want to keep the history, you can use your working copy to import into the new repository.  But hopefully this isn\'t the case.</p>\n'}, {'answer_id': 49493, 'author': 'pirho', 'author_id': 3911, 'author_profile': 'https://Stackoverflow.com/users/3911', 'pm_score': 2, 'selected': False, 'text': '<p>You can also use the <code>svnadmin hotcopy</code> command:</p>\n\n<pre><code>svnadmin hotcopy OLD_REPOS_PATH NEW_REPOS_PATH\n</code></pre>\n\n<p>It takes a full backup from repository, including all hooks, configuration files, etc.</p>\n\n<p><a href="http://svnbook.red-bean.com/en/1.8/svn.ref.svnadmin.c.hotcopy.html" rel="nofollow noreferrer">More at SVN Book</a></p>\n'}, {'answer_id': 49501, 'author': 'Gishu', 'author_id': 1695, 'author_profile': 'https://Stackoverflow.com/users/1695', 'pm_score': 3, 'selected': False, 'text': '<p>Excerpt from my <a href="http://madcoderspeak.blogspot.com/2007/12/my-lil-subversion-jumpstart-tutorial.html" rel="nofollow noreferrer">Blog-Note-to-myself</a>:</p>\n\n<p>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.</p>\n\n<p>Commands for Unix-like systems (from terminal):</p>\n\n<pre><code>svnadmin dump /path/to/your/old/repo &gt; backup.dump\nsvnadmin load /path/to/your/new/repo &lt; backup.dump.dmp\n</code></pre>\n\n<p>Commands for Microsoft Windows systems (from cmd shell):</p>\n\n<pre><code>svnadmin dump C:\\path\\to\\your\\old\\repo &gt; backup.dump\nsvnadmin load C:\\path\\to\\your\\old\\repo &lt; backup.dump\n</code></pre>\n'}, {'answer_id': 65486, 'author': 'Sander Rijken', 'author_id': 5555, 'author_profile': 'https://Stackoverflow.com/users/5555', 'pm_score': 3, 'selected': False, 'text': '<p>You can also use svnsync. This only requires read-only access on the source repository</p>\n\n<p><a href="http://svnbook.red-bean.com/en/1.8/svn.ref.svnsync.c.copy-revprops.html" rel="nofollow noreferrer">more at svnbook</a></p>\n'}, {'answer_id': 2218313, 'author': 'Ray', 'author_id': 268284, 'author_profile': 'https://Stackoverflow.com/users/268284', 'pm_score': 3, 'selected': False, 'text': '<p>If you do not have file access to the repository, I prefer <a href="http://rsvndump.sourceforge.net/" rel="nofollow noreferrer">rsvndump</a> (remote Subversion repository dump) to make the dump file.</p>\n'}, {'answer_id': 5346380, 'author': 'tkdave', 'author_id': 311432, 'author_profile': 'https://Stackoverflow.com/users/311432', 'pm_score': 5, 'selected': False, 'text': '<p><code>rsvndump</code> worked great for me migrating a repository from svnrepository.com to an Ubuntu server that I control.</p>\n\n<h2>How to install and use rsvndump on Ubuntu:</h2>\n\n<ol>\n<li><p>Install missing dependencies ("APR" and Subversion libraries)</p>\n\n<pre><code>sudo apt-get install apache2-threaded-dev\nsudo apt-get install libsvn-dev\n</code></pre></li>\n<li><p>Install rsvndump</p>\n\n<pre><code>wget http://prdownloads.sourceforge.net/rsvndump/rsvndump-0.5.5.tar.gz\ntar xvfz rsvndump-0.5.5.tar.gz\ncd rsvndump-0.5.5\n./configure\nmake\nsudo make install\n</code></pre></li>\n<li><p>Dump the remote SVN repository to a local file</p>\n\n<pre><code>rsvndump http://my.svnrepository.com/svn/old_repo &gt; old_repo_dump\n</code></pre></li>\n<li><p>Create a new repository and load in the local dump file</p>\n\n<pre><code>sudo svnadmin create /opt/subversion/my_new_rep\nsudo svnadmin load --force-uuid /opt/subversion/my_new_repo &lt; old_repo_dump\n</code></pre></li>\n</ol>\n'}, {'answer_id': 18648699, 'author': 'Braiam', 'author_id': 792066, 'author_profile': 'https://Stackoverflow.com/users/792066', 'pm_score': 2, 'selected': False, 'text': '<p>I found an article about how to move svn repositories from a hosting service to another, and how to do local backups:</p>\n\n<ol>\n<li><p>Define where you will store your repositories:</p>\n\n<pre><code>mkdir ~/repo\nMYREPO=/home/me/someplace ## you should use full path here\n</code></pre></li>\n<li>Now create a empty svn repository with <code>svnadmin create $MYREPO</code></li>\n<li><p>Create a hook file and make it executable:</p>\n\n<pre><code>echo \'#!/bin/sh\' &gt; $MYREPO/hooks/pre-revprop-change\nchmod +x $MYREPO/hooks/pre-revprop-change\n</code></pre></li>\n<li><p>Now we can start importing the repository with <code>svnsync</code>, that will initialize a destination repository for synchronization from another repository:</p>\n\n<pre><code>svnsync init file://$MYREPO http://your.svn.repo.here/\n</code></pre></li>\n<li><p>And the finishing touch to transfer all pending revisions to the destination from the source with which it was initialized:</p>\n\n<pre><code>svnsync sync file://$MYREPO\n</code></pre></li>\n</ol>\n\n<p>There now you have a local svn repository in the <code>~/repo</code> directory.</p>\n\n<p>Source:</p>\n\n<ul>\n<li><a href="http://kylecordes.com/2007/svnsync-svn-backup" rel="nofollow">http://kylecordes.com/2007/svnsync-svn-backup</a></li>\n<li><a href="http://www.workhabit.com/blog/moving-svn-repository-hosted-service" rel="nofollow">http://www.workhabit.com/blog/moving-svn-repository-hosted-service</a></li>\n</ul>\n'}, {'answer_id': 20395184, 'author': 'bahrep', 'author_id': 761095, 'author_profile': 'https://Stackoverflow.com/users/761095', 'pm_score': 2, 'selected': False, 'text': '<p>Basically, there are plenty of ways to accomplish the task. The topic is covered in depth in <a href="http://svnbook.red-bean.com/en/1.8/svn.reposadmin.maint.html#svn.reposadmin.maint.migrate" rel="nofollow"><strong>SVNBook | Migrating Repository Data Elsewhere</strong></a>, so I suggest reading the book\'s section.</p>\n\n<p>Here is a brief description of your options:</p>\n\n<ul>\n<li><p>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.</p></li>\n<li><p>You can use <a href="http://svnbook.red-bean.com/en/1.8/svn.ref.svnadmin.c.dump.html" rel="nofollow"><code>svnadmin dump</code></a> and <a href="http://svnbook.red-bean.com/en/1.8/svn.ref.svnadmin.c.load.html" rel="nofollow"><code>svnadmin load</code></a> commands to, ehm, generate full dump and then load it to another repository on another server. You will need to <a href="http://svnbook.red-bean.com/en/1.8/svn.ref.svnadmin.c.create.html" rel="nofollow"><code>svnadmin create</code></a> a new clean repository to load the dump into it. Keep in mind that the approach deals with repository history only and <strong>does not move hook scripts and repository configuration files</strong>! As well, you must have read filesystem access to the original repository to dump it.</p></li>\n<li><p>Since Subversion 1.7, <a href="http://svnbook.red-bean.com/en/1.8/svn.reposadmin.maint.html#svn.reposadmin.maint.migrate.svnrdump" rel="nofollow"><code>svnrdump</code></a> tool is available. Generally speaking, it mimics <code>svnadmin dump</code> and <code>svnadmin load</code> 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.</p></li>\n<li><p>Another option is to use <a href="http://svnbook.red-bean.com/en/1.8/svn.ref.svnadmin.c.hotcopy.html" rel="nofollow"><code>svnadmin hotcopy</code></a> 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.</p></li>\n</ul>\n'}]
['https://Stackoverflow.com/questions/49450', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1344/']