跨服务器迁移 Subversion 存储库

发布于 2024-12-08 01:07:48 字数 355 浏览 3 评论 0原文

我们正在迁移服务器,最后一项是迁移 svn 存储库。

大约有 10 个不同的 svn 存储库。它们是使用以下命令创建的: svnadmin create --fs-type fsfs

服务器 A(原始)具有 svn 1.4,而服务器 B(目标)具有 svn 1.6。

我的想法是使用 rsync 来迁移整套存储库(它们都在服务器上的 1 个文件夹中),但我担心有些东西可能不会被迁移,或者我需要特殊的开关rsync 才能正常工作。

大多数在线教程仅讨论一次移动 1 个存储库,例如使用 svnadmin hotcopy ,但我需要总共移动大约 100 个存储库。这是正确的做法吗?

We're in the process of moving servers and one of the last items is moving over the svn repositories.

There are about 10 gigs of various svn repositories. They were created using this command:
svnadmin create --fs-type fsfs

Server A(original) has svn 1.4 while Server B(target) has svn 1.6.

My thought was to use rsync to migrate the whole set of repositories (they are all in 1 folder on the server), but I am worried that some things might either not get migrated or I need special switches for rsync for this to work.

Most online tutorials only talk about moving 1 repository at a time, for example using svnadmin hotcopy, but I need to move about 100 or so all together. Is this the right way to go about it?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

残月升风 2024-12-15 01:07:48

Subversion 的 FSFS 在复制和移动方面非常稳定,即使跨不同的操作系统也是如此。虽然 mliebelt 通过转储重新加载来实现这一点是正确的,但移动 10 GB 需要很长时间

这就是为什么我建议执行以下过程:

  1. 通过文件系统将存储库复制到新服务器。
    例如 $ scp -r /var/repos/ user@newServer:repos/

  2. 执行 $ svnadmin Upgrade 对 1.6 的存储库进行更新(这是可选的) ,但如果您想使用 1.5/1.6 功能(例如合并跟踪、稀疏签出等),强烈建议您这样做。)

  3. 在每个存储库上执行 $ svnadmin verify 以验证所有修订版本好的(您可以在已运行的服务器上执行此操作)。

通过此过程,您可能需要减少 10 到 100 倍的时间:

例如,转储存储库通常需要大约每小时 1 GB(很大程度上取决于 HD 速度),转储文件比存储库(在 SVN 1.4 中!)
因此,您必须将较大的文件移动到新服务器并进行转储加载,这也需要大约 1 小时/GB。将此与文件系统副本进行比较,文件系统副本通常仅受网络连接(100 MB 约 10 MB/秒)或 HD(约 100 MB/秒)的限制(如果您有 GBit-LAN​​)。

Subversion's FSFS is pretty stable on doing copies and movements, even across different OSes. While mliebelt is correct about doing it via dump reload, it takes ages to move 10 GB!

That's why I would recommend the following procedure:

  1. Copy the repositories via filesystem to new server.
    e.g. $ scp -r /var/repos/ user@newServer:repos/

  2. Do an $ svnadmin upgrade to do an update on repository for 1.6 (this is optional, but highly recommended if you want to use 1.5/1.6 features like merge tracking, sparse checkouts, etc.)

  3. Do an $ svnadmin verify on each repository to verify all revisions are okay (You can do this on already running server).

By this procedure you need probably 10 to 100 times less time:

e.g. for dumping a repository it takes usually approx 1 GB per hour (largely depending on HD-speed), the dump files are much bigger than the repositories(in SVN 1.4!)
So you have to move the larger file to the new server and do there an dump-load which also takes approx 1 hrs / GB. Compare this to a filesystem copy which usually is only limited by network connection (100 mbit approx. 10 MB / sec) or HD (approx 100 MB/sec), if you have GBit-LAN.

梦幻的味道 2024-12-15 01:07:48

首先,我不是 Subversion 管理员,但我经常与他们一起工作。所以不要只相信我的话,也要检查其他来源。

我过去 5 年的经验是:

  • 要移动 Subversion 存储库,您应该使用 Subversion 管理工具 dumpload。它们是专门为这项工作而编写的。
  • dumpload 另外检查一切是否正常。通过使用它们,您可以获得额外的“保险”,确保一切顺利。
  • 我们从未迁移过超过 2 个主要版本,而是从一个主要版本迁移到下一个主要版本。您至少应该检查是否支持从 1.4.x 迁移到 1.6.x。通常,新的服务器版本支持直接以前的版本,并支持迁移。因此,也许您必须为每个存储库进行两次迁移。
  • 只要旧存储库正在移动,您就可以在它们上工作,因为 subversion 允许您添加以后更新的修订版本。
  • 因为所有操作都可以通过命令行完成,所以您可以将大部分操作自动化,并且 subversion 管理员只需检查一切是否运行良好。

所以,是的,我建议一个接一个地移动存储库。

First of all, I am not a Subversion administrator, but I work a lot with them. So don't trust my words only, check other sources as well.

My experience over the last 5 years was:

  • To move Subversion repositories, you should use the Subversion admin tools dump and load. They are written just for that job.
  • dump and load check additionally that everything is ok. By using them, you get additional "insurance" that everything moved ok.
  • We have never migrated over 2 major versions, but moved from one major version to the next. You should at least check, that migration from 1.4.x to 1.6.x is supported. Often the new server version support the direct previous version, and supports the migration. So perhaps you have to do the migration for each repository twice.
  • You may work on the old repositories as long as they are moving, because subversion allows you to add later newer revisions.
  • Because all can be done by command line, you may automate most of it, and the subversion admins only have to check that everything has worked well.

So, yes, I would recommend to move one repository after each other.

没有心的人 2024-12-15 01:07:48

有关 svn 1.6 的 svnadmin dumpsvnadmin load 的更多信息,请参阅 此处。它提供了一些有关 dumpload 的讨论,以及诸如 --deltas--incremental 等选项,和其他人。

另外,请注意,如果您进行直接复制和 svnadmin 升级,您可以节省时间,但存储库状态可能不是最佳的。来自 svnadmin 帮助:

svnadmin 帮助升级

用法:svnadmin升级REPOS_PATH

将位于 REPOS_PATH 的存储库升级到最新支持的版本
架构版本。

提供此功能是为了方便存储库
希望使用 Subversion 新功能的管理员
无需进行可能成本高昂的完整存储库转储
和负载操作。因此,升级仅执行最低限度的操作
完成此任务所需的工作量,同时仍保持
存储库的完整性。 不保证最优化
存储库状态作为转储和后续加载。

For more info on svnadmin dump and svnadmin load for svn 1.6 see here. It offers some discussion on dump and load, as well as options like --deltas, --incremental, and others.

Also, be warned that if you do a straight copy and svnadmin upgrade you save time, but the repository state may not be optimal. From the svnadmin help :

svnadmin help upgrade

usage: svnadmin upgrade REPOS_PATH

Upgrade the repository located at REPOS_PATH to the latest supported
schema version.

This functionality is provided as a convenience for repository
administrators who wish to make use of new Subversion functionality
without having to undertake a potentially costly full repository dump
and load operation. As such, the upgrade performs only the minimum
amount of work needed to accomplish this while still maintaining the
integrity of the repository. It does not guarantee the most optimized
repository state as a dump and subsequent load would.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文