简体   繁体   English

当 svnadmin 转储没有帮助时,如何将项目从一个 SVN 存储库移动到另一个存储库

[英]How to move project from one SVN repository to another when svnadmin dump does not help

We have huge SVN repository with multiple projects and we need to move one of them to another SVN repository.我们有包含多个项目的巨大 SVN 存储库,我们需要将其中一个移动到另一个 SVN 存储库。

The straight forward way to do it (dump database by svnadmin dump, filter it by svndumpfilter and reload it to the new repository does not work because the repository is too big (dump file is about 500GB) and svndumpfilter and other similar programs never end.直接的方法(通过 svnadmin dump 转储数据库,通过 svndumpfilter 过滤并将其重新加载到新的存储库中不起作用,因为存储库太大(转储文件约为 500GB)并且 svndumpfilter 和其他类似程序永远不会结束。

I used snvsync to copy the specific project to the new repository.我使用 snvsync 将特定项目复制到新存储库。 It works fine except 2 points:它工作正常,除了 2 点:

  • I read that repository populated by svnsync is intended to be read-only.我读到由 svnsync 填充的存储库是只读的。 I tried to commit changes to this repository (after I removed the hook that prevents me from doing so) and it seems to work.我试图提交对这个存储库的更改(在我删除了阻止我这样做的钩子之后)并且它似乎有效。 Still, I'm not sure it will not cause troubles in the future.不过,我不确定它是否会在未来造成麻烦。
  • The final folder structure I got in the new repository is:我在新存储库中得到的最终文件夹结构是:

    /repos/trunk/projectA/ /repos/trunk/projectA/

When I try to branch (copy) projectA to /repos/branches/projectA I get an error: "Repository moved permanently to http:/host/repos/; please relocate"当我尝试将 projectA 分支(复制)到 /repos/branches/projectA 时,出现错误:“存储库永久移动到 http:/host/repos/;请重新定位”

Any attempt to create folder on the same level as trunk produces the same error.任何在与主干相同级别创建文件夹的尝试都会产生相同的错误。 In the end I want to get to the "strandard" folder sturucture like:最后,我想进入“标准”文件夹结构,例如:

/repos/projectA/trunk
/repos/projectA/branches
/repos/projectA/tags

but did not find a way to overcome the error above.但没有找到克服上述错误的方法。

A svnsync copy is supposed to be readonly for obvious reasons - if you commit to it, and then continue the syncing from the original, the copy will not be the same.出于显而易见的原因,svnsync 副本应该是只读的 - 如果您提交它,然后继续从原始同步,副本将不一样。 It should error on you when you try to sync it afterwards, but that's the only reason.当您之后尝试同步它时,它应该会出错,但这是唯一的原因。 There's no technical reason why it should be RO, and in fact, once you have a copy and your original dies, it is designed to be an identical copy that you can start to use as a backup replacement.它应该是 RO 没有技术上的原因,事实上,一旦你有一个副本并且你的原件死了,它被设计成一个相同的副本,你可以开始用作备份替代品。

Your problem with using it is because you're still using your original working copy that refers to the original repo.您使用它的问题是因为您仍在使用引用原始存储库的原始工作副本。 You need to either delete the WC and re-checkout, or tell it that the repository has moved - using the svn switch --relocate command.您需要删除 WC 并重新签出,或者告诉它存储库已移动 - 使用svn switch --relocate命令。 I don't understand how you could use svnsync to get a different layout from your original repo though (unless you mean you want to alter the layout after you've synced it to fit - you could still dump, filter and load the small repo to the new one)我不明白您如何使用 svnsync 来获得与原始存储库不同的布局(除非您的意思是在同步后更改布局以适应 - 您仍然可以转储、过滤和加载小型存储库到新的)

Have you tried rsvndump which allows you to dump partial repositories.您是否尝试过允许您转储部分存储库的rsvndump

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM