备份 SVN 存储库所需的文件

发布于 2024-08-11 02:37:02 字数 320 浏览 2 评论 0原文

我需要备份 SVN 存储库的一个文件夹。为此,我尝试使用 svndump 和 svndumpfilter 命令,但没有用。

任何人都可以通过一个例子解释如何做到这一点。

更新:

我有一个存储库,其中有一个文件夹说“测试”。除了这个“测试”之外,我的存储库中还有一些文件夹/项目。如果我想对我的存储库进行完整备份,它会消耗更多内存(30 GB),所以我只想将具有历史记录的“Test”文件夹转移到另一个存储库,以便我可以仅对“Test”进行定期备份文件夹(新存储库),因为它将占用更少的内存。 (除了“Test”之外,我不需要定期备份其他文件夹)

我该如何执行此操作?

I need to take the backup of one folder of my SVN repository. For this I have tried with svndump and svndumpfilter commands but of no use.

Can any one please explain how to do this with an example.

Update:

I have a repository in that I have one folder say "Test". Apart from this "test" there are some more folders/projects in my repository. If I want to take the full backup of my repository its consuming more memory (30 gb) so I want to shift only the "Test" folder with the history to another repository so that I can take the regular backups of only the "Test" folder (new repository) as it will take less memory. (I don't need to take the regular backups of other folders except "Test")

How can I do this?

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

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

发布评论

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

评论(3

聚集的泪 2024-08-18 02:37:02

如果您想要的是文件本身的当前状态的备份(并且实际上并不需要完整版本历史记录),请使用svn export 代替。

如果您试图支持历史,那么我同意罗希斯的回答。

If what you're wanting is a backup of the current state of the files themselves (and don't actually want the full version history), use svn export instead.

If you are trying to back up the history, then I concur with Rohith's answer.

梨涡 2024-08-18 02:37:02

由于每次提交时 SVN 都会对整个树进行版本控制,因此如果您尝试仅备份源树的一部分,然后尝试恢复该备份,则可能会遇到麻烦。

Since SVN versions the whole tree every time a commit is made, you're likely to run into trouble if you try to backup only a portion of the source tree and then try to restore that backup.

放手` 2024-08-18 02:37:02

根据您的后续操作,您想要做的是从单个源存储库生成两个新存储库。

SVN红皮书对此解释得很好:
http://svnbook。 red-bean.com/nightly/en/svn.reposadmin.maint.html#svn.reposadmin.maint.filtering

简而言之,您从一个存储库开始并创建一个转储文件,然后使用svndumpfilter生成两个过滤后的转储文件(一个带有测试,一个没有)。

svnadmin dump origin > origin.dump
svndumpfilter include Test < origin.dump > testonly.dump
svndumpfilter exclude Test < origin.dump > no-test.dump

如果您感觉很活跃,可以编辑两个过滤的转储文件以排除根节点创建语句(在文档链接中讨论)。

创建新的存储库:

svnadmin create testrepo
svnadmin create neworigin

现在,加载转储文件:

svnadmin load --ignore-uuid testrepo < testonly.dump
svnadmin load --ignore-uuid neworigin < no-test.dump

现在,您有了两个新的存储库,因此您暂停了 origin 存储库中的开发,并转而使用 neworigin 和 < em>testrepo 存储库。从那里,您可以使用 svnadmin dump 仅为 testrepo 生成转储文件,并将转储文件放入正常的备份过程中。

svnadmin dump testrepo > testrepo-backup.dump

Based on your followup, what you're wanting to do is to generate two new repositories from the single origin repo.

The SVN red book explains this well:
http://svnbook.red-bean.com/nightly/en/svn.reposadmin.maint.html#svn.reposadmin.maint.filtering

In a nutshell, you start with an origin repo and create a dumpfile, and then use svndumpfilter to generate the two filtered dumpfiles (one with Test, one without).

svnadmin dump origin > origin.dump
svndumpfilter include Test < origin.dump > testonly.dump
svndumpfilter exclude Test < origin.dump > no-test.dump

If you're feeling frisky, you can edit the two filtered dumpfiles to exclude the root node creations statements (talked about in the docs link).

Create the new repos:

svnadmin create testrepo
svnadmin create neworigin

Now, load the dumpfiles:

svnadmin load --ignore-uuid testrepo < testonly.dump
svnadmin load --ignore-uuid neworigin < no-test.dump

Now, you have the two new repos, so you suspend development in the origin repo and move to using the neworigin and testrepo repos. From there, you can use svnadmin dump to generate the dumpfiles for just the testrepo and put the dumpfile in your normal backup procedure.

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