How can I dump all svn data while I lost some revisions in the repository?

一个人想着一个人 提交于 2019-12-10 11:05:25

问题


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

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

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

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

How can I move all my svn data to the new location?


回答1:


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. 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

  2. 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

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

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

  4. 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

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!



来源:https://stackoverflow.com/questions/22776399/how-can-i-dump-all-svn-data-while-i-lost-some-revisions-in-the-repository

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!