Backup Specified Revision

  1. Backup specified revision (here is 20):

$ cd /opt/svnRepo

$ svnadmin dump deployTest/ -r 20 > deploy-r20.dump

  1. Restore backup:

$ mv deploy-r20.dump /opt/Gcp/tmp

$ cd /opt/Gcp/tmp

$ svnadmin create deploy20

$ svnadmin load deploy20 < deploy-r20.dump

Verify

  1. Get revision 20 of "deploy.exp" in original repository

$ svn cat -r 20 file:///opt/svnRepo/deployTest/CalcServer/deploy.exp > r20

  1. Get "deploy.exp" in restored repository

$ svn cat file:///opt/Gcp/tmp/deploy20/CalcServer/deploy.exp > restore20

  1. Compare them:

$ diff r20 restore20

They are identical.

  1. Compare logs:

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

Backup Specified Revisions

$ svnadmin dump deployTest/ -r 10:20 > deploy-r20.dump

Incremental Backup

  1. Backup:

$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

  1. Restore:

$svnadmin load myrepos < 0-1000.dumpfile
$svnadmin load myrepos < 1001-2000.dumpfile
$svnadmin load myrepos < 2001:3000.dumpfile

Experiment on incremental dump

  1. Create a incremental backup:
    [root@cloud141 /opt/svnRepo]$ svnadmin dump deployTest/ --incremental -r 9:11 > r9-11.dump
  2. Create a full backup:
    [root@cloud141 /opt/svnRepo]$ svnadmin dump deployTest/ -r 9:11 > backup9-11.dump
  3. Compare the size of these two dump files, full backup is obviously larger than the incremental counterpart:
    [root@cloud141 /opt/svnRepo]$ ll
    total 984
    -rw-r--r-- 1 root root 997105 Oct 31 19:08 backup9-11.dump
    drwxr-xr-x 6 root root 4096 Aug 22 18:09 deployTest
    -rw-r--r-- 1 root root 2509 Oct 31 19:07 r9-11.dump
  4. Restore a incremental backup in a fresh repository:
    [root@cloud141 /opt/svnRepo]$ mv r9-11.dump ../Gcp/tmp
    [root@cloud141 /opt/Gcp/tmp]$ svnadmin create new9
    [root@cloud141 /opt/Gcp/tmp]$ svnadmin load new9 < r9-11.dump
    <<< Started new transaction, based on original revision 9
    svnadmin: File not found: transaction '0-0', path 'CalcServer/src/com/boco/deploy/ConfigLoader.java'
  5. editing path : CalcServer/src/com/boco/deploy/ConfigLoader.java ...[root@
    You can see the restore failed.
  6. Restore a incremental backup (revision 9~11) in a "root" repository (restored from revision 8) :
    [root@cloud141 /opt/Gcp/tmp]$ svnadmin load backup8 < r9-11.dump
    ...
    [root@cloud141 /opt/Gcp/tmp]$ svn log file:///opt/Gcp/tmp/backup8

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.

Summary

Backup a huge repository in the following steps:

  1. Execute a full backup at a revision. If the revision n is not 0, you will lose all revisions from 0 to n-1;

  2. Execute incremental backups weekly, use the revision arrange as file name: "inc-rev-from-to.dump", like "inc-rev-35-46.dump";

  3. When original repository corrupts, first load the full backup, then load the incremental ones according to their revision numbers;

Ref:

Subversion Backup and Restore的更多相关文章

  1. TFS Express backup and restore

    When we setup source control server, we should always make a backup and restore plan for it. This ar ...

  2. 转:db2 backup 及 restore

    db2 backup 及 restore 2011-06-21 18:12:20|  分类: AIX |举报 |字号 订阅     两个问题: db2=>list applications db ...

  3. 第一章、关于SQL Server数据库的备份和还原(sp_addumpdevice、backup、Restore)

    在sql server数据库中,备份和还原都只能在服务器上进行,备份的数据文件在服务器上,还原的数据文件也只能在服务器上,当在非服务器的机器上启动sql server客户端的时候,也可以通过该客户端来 ...

  4. [转]Configure Network Drive Visible for SQL Server During Backup and Restore Using SSMS

    本文转自:https://mytechmantra.com/LearnSQLServer/Configure-Network-Drive-Visible-for-SQL-Server-During-B ...

  5. Backup and restore of FAST Search for SharePoint 2010

    一个同事问我一个问题: 如果FAST Search for SharePoint 2010被full restore到了一个之前的时间点, 那么当FAST Search重新开始一个增量爬网的时候, 会 ...

  6. SQL Server Database Backup and Restore in C#

    SQL Server Database Backup and Restore in C# Syed Noman Ali Shah,                          7 Feb 201 ...

  7. csharp: SQL Server 2005 Database Backup and Restore using C#

    1.第一种方式: using SQLDMO;//Microsoft SQLDMO Object Library 8.0 /// <summary> /// 数据库的备份 /// 涂聚文注: ...

  8. Experience on Namenode backup and restore --- checkpoint

    Hadoop version: Hadoop 2.2.0.2.0.6.0-0009 Well, We can do this by building Secondary Namenode, Check ...

  9. Backup and Restore MySQL Database using mysqlhotcopy

    mysqlhotcopy is a perl script that comes with MySQL installation. This locks the table, flush the ta ...

随机推荐

  1. 十九、.net core使用SoapCore开发webservice接口,以及使用HttpClientFactory动态访问webservice接口

    使用SoapCore实现在.net core平台下开发webservice:以及使用HttpClientFactory动态访问webservice. 首先,需要在包项目下面引用SoapCore: 然后 ...

  2. IDA Pro 6.0使用Qt 框架实现了跨平台的UI

    IDA Pro 6.0使用Qt 框架实现了跨平台的UI.它的好处是插件编写者还可以直接使用 Qt 开发跨平台 UI.但是编剧呢? 在这篇博文中,我们将说明如何使用PySide使用IDAPython为 ...

  3. Redis数据库 常用的基本操作

    一.redis数据库操作 redis数据库默认有16个数据库[0-15],默认进入的是0库. select  数据库名 :切换数据库. keys  * :查看所有的键. expire 键 秒数:设置过 ...

  4. MIT6.828 Lab4 Preemptive Multitasking(下)

    Lab4 Preemptive Multitasking(下) lab4的第二部分要求我们实现fork的cow.在整个lab的第一部分我们实现了对多cpu的支持和再多系统环境中的切换,但是最后分析的时 ...

  5. [网络流24题]最长k可重区间集[题解]

    最长 \(k\) 可重区间集 题目大意 给定实心直线 \(L\) 上 \(n\) 个开区间组成的集合 \(I\) ,和一个正整数 \(k\) ,试设计一个算法,从开区间集合 \(I\) 中选取开区间集 ...

  6. golang开发:Error的使用

    Error是Go语言开发中最基础也是最重要的部分,跟其他语言的try catch的作用基本一致,想想在PHP JAVA开发中,try catch 不会使用,或者使用不灵活,就无法感知到程序运行中出现了 ...

  7. C语言:冒泡排序例子

    //冒泡排序 //14个数字排序:14个数的组合:14*13/2=91次 理论上比较91次 ,实际只有39次进行了变量交换 #include <stdio.h> void bubble_s ...

  8. C语言:键盘输入

    C语言有多个函数可以从键盘获得用户输入,它们分别是: scanf():和 printf() 类似,scanf() 可以输入多种类型的数据. getchar().getche().getch():这三个 ...

  9. 《面试八股文》之 Redis 16卷

    微信公众号:moon聊技术 关注选择" 星标 ", 重磅干货,第一 时间送达! [如果你觉得文章对你有帮助,欢迎关注,在看,点赞,转发] 大家好,我是 moon. redis 作为 ...

  10. vue3 自学(一)基础知识学习和搭建一个脚手架

    两年前曾自学过几天vue,那时候版本还是vue2,但后来项目中一直没用到,当时也觉得学习成本太高,便没有继续学习下去.初学者可以看下链接文章以前的吐槽~~ 学习 Vue ,从入门到放弃 最近部门决定升 ...