如何迁移svn库 简单的dump/load方式

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了如何迁移svn库 简单的dump/load方式相关的知识,希望对你有一定的参考价值。

参考技术A 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 yoursvnadmin 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.
FAQ's
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.

SVN迁移

SVN迁移和MySQL 逻辑备份类似

先说次最简单的迁移,用到两个命令工具 svnadmin  dump ,svnadmin load

导出旧的svn库:

svnadmin dump svndata/ > /opt/svndata.svn

创建新的svn库:

svnadmin create /data/svndata

导入svndata.svn到新的库

svnadmin load svndata/ <svndata.svn

拷贝之前的配置(svnserve.conf),用户及密码(passwd),还有权限配置文件(authz)


本文出自 “一步小心踏破了红尘” 博客,请务必保留此出处http://lorne.blog.51cto.com/9062483/1776044

以上是关于如何迁移svn库 简单的dump/load方式的主要内容,如果未能解决你的问题,请参考以下文章

SVN迁移

Linux下SVN服务器迁移

linux系统之间的svn库迁移步骤,请教高手

SVN备份迁移

SVN从win迁移到Linux上

如何将 SVN 存储库迁移到另一个 SVN 存储库?