开发者

To take the backup of required files of SVN repository

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?


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.


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.


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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜