在存储库中丢失某些修订版本时,如何转储所有svn数据? [英] How can I dump all svn data while I lost some revisions in the repository?

查看:233
本文介绍了在存储库中丢失某些修订版本时,如何转储所有svn数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想转储旧的svn源并将其加载到新计算机上.我以前的svn存储库大约有100GB.

I want to dump my old svn source and load it to my new computer. My old svn repository is about 100GB huge.

  • 当我使用svnadmin dump /xx/Repositoryfile > mydump转储svn文件时,得到了512Mb大小的文件.最后,我找到了原因:

  • When I use svnadmin dump /xx/Repositoryfile > mydump to dump svn file, I got a 512Mb sized file. Finally, I found why:

因为修订版302已丢失.我只能获取1-301修订版的数据.

because the revision 302 has been lost. I can only get 1-301 revision's data.

即使使用svnadmin dump /xx/Repositoryfile -r 303:90000--incremental > mydump来获取其他来源.无法加载.

Even if use svnadmin dump /xx/Repositoryfile -r 303:90000--incremental > mydump to get the other source. It can't be loaded.

如何将所有svn数据移至新位置?

推荐答案

如果在存储库未处于损坏状态(例如,丢失了修订的版本)时拥有该存储库的备份,则可以修复该存储库.我建议按照以下步骤修复存储库:

If you have a backup of the repository when it's not in corrupted state (i.e. when it has those lost revisions) then you can repair the repository. I suggest following these steps to repair the repository:

  1. 首先,应检查原始转储中是否存在除302之外的其他已损坏的修订版.您可以使用以下命令行检查特定修订范围的一致性:

  1. At first, you should check whether there are corrupted revisions other than 302 in the original dump. You can check the particular revision range for consistency by using the following command line:

svnadmin verify /xx/Repositoryfile -r 302:HEAD

如果除302之外没有损坏的修订,则应转储所有 有效的修订.

If there are no corrupted revisions except 302, then you should dump all revisions that are valid.

svnadmin dump /xx/Repositoryfile -r 0:300 > dump1.dmp

svnadmin dump /xx/Repositoryfile -r 302:HEAD > dump2.dmp

找到未损坏301修订版本的存储库备份,并仅转储此修订版本:

Locate the repository backup that has the 301 revision NOT corrupted and dump only this revision:

svnadmin dump /xx/Repositoryfile -r 301 > dump3.dmp

创建一个干净的存储库(通过命令

Create a clean repository (via the command svnadmin create <repo-name>) and load all these dumps one by one ((!)note that dump3.dmp must be loaded in second sequence).

svnadmin load <repo-path> < dump1.dmp

svnadmin load <repo-path> < dump3.dmp

svnadmin load <repo-path> < dump2.dmp

这样,您将恢复存储库.如果您有301以外的其他受损版本,则必须执行更多步骤,但方法仍然相同.我希望它会有所帮助!

This way you will recover the repository. If you have other corrupted revisions other than 301, you will have to perform more steps but the approach is still the same. I do hope it helps!

这篇关于在存储库中丢失某些修订版本时,如何转储所有svn数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆