将 Subversion 存储库的一部分迁移到新服务器并重新指定路径

发布于 2024-10-25 08:51:01 字数 1104 浏览 7 评论 0原文

我正在尝试将 Subversion 存储库的一部分迁移到新的 Subversion 服务器。

http://server1/svn/repo1/path1/path2/path3 -> http://server2/svn/repo2/path3

我已经通过以下方式创建了完整的转储:

svnadmin dump repo1 > repo1.dump

通过 Cygwin sed过滤转储

svndumpfilter include /path1/path2 --drop-empty-revs < repo1.dump > repo1_filtered.dump

,我正在替换 /path1/path2:

sed -e 's,^Node-path: WM/BI,Node-path: ,' < repo1_filtered.dump > repo1_fixed.dump

在尝试导入时转储到新的/空的存储库中时,我收到以下错误:

<<< Started new transaction, based on original revision 32
 * adding path :  ...svnadmin: File already exists: filesystem 'bi\db', transaction '0-2', path ''

我相信问题是 svndumpfilter 包含路径 /path1/path2。真的,我只想要 /path1/path2 的孩子。运行 sed 后,在 repo1_fixed.dump 的开头附近,我发现:

2010-03-10T15:56*:59.595747Z
PROPS-END

Node-path:
Node-action: add
Node-kind: dir
Prop-content-length: 10
Content-length: 10

PROPS-END

我的猜测是空节点路径是问题的真正原因。

关于我应该如何进行有什么建议吗?

I'm attempting to migrate part of an Subversion repository to a new Subversion server.

http://server1/svn/repo1/path1/path2/path3 -> http://server2/svn/repo2/path3

I've created a complete dump via:

svnadmin dump repo1 > repo1.dump

Filtered the dump via:

svndumpfilter include /path1/path2 --drop-empty-revs < repo1.dump > repo1_filtered.dump

Via Cygwin sed, I'm replacing /path1/path2:

sed -e 's,^Node-path: WM/BI,Node-path: ,' < repo1_filtered.dump > repo1_fixed.dump

While attempting the import the dump into a new/empty repository, I get the following error:

<<< Started new transaction, based on original revision 32
 * adding path :  ...svnadmin: File already exists: filesystem 'bi\db', transaction '0-2', path ''

I believe the problem is that the svndumpfilter is including the path /path1/path2. Really, I only want the children of /path1/path2. After running sed, near the beginning of repo1_fixed.dump, I find:

2010-03-10T15:56*:59.595747Z
PROPS-END

Node-path:
Node-action: add
Node-kind: dir
Prop-content-length: 10
Content-length: 10

PROPS-END

My guess is that the empty node path is the real cause of the problem.

Any suggestions on how I should proceed?

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

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

发布评论

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

评论(1

谈下烟灰 2024-11-01 08:51:01

我很容易地重现了你的问题,而且你的分析是正确的。问题是创建基本文件夹的修订。

如果您从转储中删除此事务,它会正确导入

 sed -e "s,^Node-path: rep1/rep3,Node-path: ," < temp_filtered.dump > temp_hacke.txt

,我手动完成了它,这相当简单:只需查找具有空节点路径的行:并从上一个“修订号:”删除到下一个“PROPS-END”。一些 python/awk/perl 可以做到这一点(我没有尝试)。

如果此文件夹中没有特殊内容(例如随时间变化的属性),则应该只出现一次。

另一个解决方案是将存储库导入到单个文件夹而不是子树中(在这种情况下,只需将 sed 行更改为 ,Node-path : newPath)

请注意,我不知道有什么工具可以为您执行此操作。

I reproduced you problem fairly easily and you're true about your analsis. The issue is the revision creating the base folder.

If you remove this transaction from your dump, it imports correctly

 sed -e "s,^Node-path: rep1/rep3,Node-path: ," < temp_filtered.dump > temp_hacke.txt

I did it manually, it's fairly easy : just look for lines with empty Node-path: and remove from previous "Revision-number:" to next "PROPS-END". Some python/awk/perl could do it (i didn't try).

If you don't have special things in this folder (like properties evolving over time), you should have only one occurence.

Another solution is to import your repository in a single folder instead of a subtree (in that case, just change your sed line to ,Node-path : newPath)

Note that I don't know of a tool which would do this for you.

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