开发者

Visual SVN multiple repositories backup

Few months ago our VisualSVN Server repositories got created, multiple repositories are exists under a single root, the structure looks as below:

Repository is located at C:\Repositories\root

root
-branches
-tags
-trunk
--repo1
---folder1
---folder2
--repo2
---folder1
---folder2

I was able to iterate thru repo1, repo2 folders using svn list commands (svn list file:///c:/Repositories/root/trunk/repo1) now I would like to back up repo1 and repo2.

I could do backup at root level, whereas backup file size is too large, would like to backup at repositories level.

I tried to use as svnadmin dump file:///c:/Repositories/root/trunk/repo1 > D:\repo1-backup.db

throws an error saying "svnadmin: file:///c:/Repositories/root/trunk/repo1' is an URL when it should be a path". Error makes sense that I used URL instead of file system paths.

I went thru help and found that I can use, have not tried yet!

1) backup the entire root svnadmin dump C:\Repositories\root > repos-开发者_StackOverflowdumpfile 2) use svndumpfilter to include repo1 svndumpfilter include repo1 < repos-dumpfile > repo1-dumpfile

I worry about step1, it leads to huge file on my disk. Would like to know is there any other way to backup my repositories.


As far as I know, there is no way to use svndump to fetch a single path from a repository.

I think you'll have indeed to do a dump of the whole thing, and then indeed use svndumpfilter on it.


You have very strange repository structure.
Typically repo1 and repo2 would be separate top level repositores with each branches, tags and trunk inside them.

But you know that if you have fsfs as database structure you can do an incremental file by file backup and only backup newer files each time.


SVNAdmin can backup each repository separately. If you have several repository you have to backup separately. You can write a script (for example bat, vbs in windows ) that backup all repositories automatically.
for backup repo1 use below command:

svnadmin.exe dump c:\Repositories\root\trunk\repo1 >  D:\repo1-backup.bak

for multiple repository use below script:
dump_repos.bat

cd c:\Repositories\root\trunk\
dir /A:D /B> dirs.tmp
FOR /F %%i IN (dirs.tmp) DO (
 "svnadmin.exe" dump %%i > %%i.svn
)
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜