$ cd /opt/svnRepo
$ svnadmin dump deployTest/ -r 20 > deploy-r20.dump
$ mv deploy-r20.dump /opt/Gcp/tmp
$ cd /opt/Gcp/tmp
$ svnadmin create deploy20
$ svnadmin load deploy20 < deploy-r20.dump
$ svn cat -r 20 file:///opt/svnRepo/deployTest/CalcServer/deploy.exp > r20
$ svn cat file:///opt/Gcp/tmp/deploy20/CalcServer/deploy.exp > restore20
$ diff r20 restore20
They are identical.
[root@cloud141 /opt/svnRepo]$ svn log -r 20 file:///opt/svnRepo/deployTest/
r20 | bvt | 2013-08-30 17:30:03 +0800 (Fri, 30 Aug 2013) | 1 line remove unittest in source file
[root@cloud141 /opt/svnRepo]$ svn log file:///opt/Gcp/tmp/deploy20
r1 | bvt | 2013-08-30 17:30:03 +0800 (Fri, 30 Aug 2013) | 1 line remove unittest in source file
So you can see the restored repository is identical to that part of original repository except the revision number.
$ svnadmin dump deployTest/ -r 10:20 > deploy-r20.dump
$svnadmin dump myrepos -r 0:1000 > 0-1000.dumpfile $svnadmin dump myrepos -r 1001:2000 --incremental > 1001-2000.dumpfile $svnadmin dump myrepos -r 2001:3000 --incremental > 2001:3000.dumpfile
$svnadmin load myrepos < 0-1000.dumpfile $svnadmin load myrepos < 1001-2000.dumpfile $svnadmin load myrepos < 2001:3000.dumpfile
r4 | bvt | 2013-08-30 16:35:10 +0800 (Fri, 30 Aug 2013) | 1 line initial import project
r3 | bvt | 2013-08-30 15:31:47 +0800 (Fri, 30 Aug 2013) | 1 line make new project basedir
r2 | bvt | 2013-08-29 14:32:15 +0800 (Thu, 29 Aug 2013) | 1 line remove unittest in source file to pass compile without junit
r1 | bvt | 2013-08-29 14:31:10 +0800 (Thu, 29 Aug 2013) | 1 line remove unittest in source file to pass compile without junit
Now the restore succeed.
Backup a huge repository in the following steps:
Execute a full backup at a revision. If the revision n is not 0, you will lose all revisions from 0 to n-1;
Execute incremental backups weekly, use the revision arrange as file name: "inc-rev-from-to.dump", like "inc-rev-35-46.dump";
When original repository corrupts, first load the full backup, then load the incremental ones according to their revision numbers;
Ref:
Subversion Backup and Restore,布布扣,bubuko.com
原文:http://www.cnblogs.com/darkmatter/p/3606753.html