Subversion Backup and Restore
Backup Specified Revision
- Backup specified revision (here is 20):
$ cd /opt/svnRepo
$ svnadmin dump deployTest/ -r 20 > deploy-r20.dump
- Restore backup:
$ mv deploy-r20.dump /opt/Gcp/tmp
$ cd /opt/Gcp/tmp
$ svnadmin create deploy20
$ svnadmin load deploy20 < deploy-r20.dump
Verify
- Get revision 20 of "deploy.exp" in original repository
$ svn cat -r 20 file:///opt/svnRepo/deployTest/CalcServer/deploy.exp > r20
- Get "deploy.exp" in restored repository
$ svn cat file:///opt/Gcp/tmp/deploy20/CalcServer/deploy.exp > restore20
- Compare them:
$ diff r20 restore20
They are identical.
- 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
- 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
- Restore:
$svnadmin load myrepos < 0-1000.dumpfile
$svnadmin load myrepos < 1001-2000.dumpfile
$svnadmin load myrepos < 2001:3000.dumpfile
Experiment on incremental dump
- Create a incremental backup:
[root@cloud141 /opt/svnRepo]$ svnadmin dump deployTest/ --incremental -r 9:11 > r9-11.dump - Create a full backup:
[root@cloud141 /opt/svnRepo]$ svnadmin dump deployTest/ -r 9:11 > backup9-11.dump - 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 - 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' - editing path : CalcServer/src/com/boco/deploy/ConfigLoader.java ...[root@
You can see the restore failed. - 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:
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的更多相关文章
- TFS Express backup and restore
When we setup source control server, we should always make a backup and restore plan for it. This ar ...
- 转:db2 backup 及 restore
db2 backup 及 restore 2011-06-21 18:12:20| 分类: AIX |举报 |字号 订阅 两个问题: db2=>list applications db ...
- 第一章、关于SQL Server数据库的备份和还原(sp_addumpdevice、backup、Restore)
在sql server数据库中,备份和还原都只能在服务器上进行,备份的数据文件在服务器上,还原的数据文件也只能在服务器上,当在非服务器的机器上启动sql server客户端的时候,也可以通过该客户端来 ...
- [转]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 ...
- Backup and restore of FAST Search for SharePoint 2010
一个同事问我一个问题: 如果FAST Search for SharePoint 2010被full restore到了一个之前的时间点, 那么当FAST Search重新开始一个增量爬网的时候, 会 ...
- SQL Server Database Backup and Restore in C#
SQL Server Database Backup and Restore in C# Syed Noman Ali Shah, 7 Feb 201 ...
- csharp: SQL Server 2005 Database Backup and Restore using C#
1.第一种方式: using SQLDMO;//Microsoft SQLDMO Object Library 8.0 /// <summary> /// 数据库的备份 /// 涂聚文注: ...
- 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 ...
- Backup and Restore MySQL Database using mysqlhotcopy
mysqlhotcopy is a perl script that comes with MySQL installation. This locks the table, flush the ta ...
随机推荐
- LRU工程实现源码(一):Redis 内存淘汰策略
目录 内存淘汰是什么?什么时候内存淘汰 内存淘汰策略 Redis中的LRU淘汰算法 源码剖析 第一步:什么时候开始淘汰key 配置读取 检查时机 getMaxmemoryState 第二步:淘汰哪些k ...
- 资源:docker-compose下载路径
docker-compose下载路径: compose所有版本:https://github.com/docker/compose/releases
- Https:证书生成 .p12 .keyStore 和 .truststore文件理解
当我们需要SSL证书时,可以自动生成SSL证书,但是每个系统都申请一次证书会比较麻烦,所以用到了如下几个文件格式: .p12(PKCS #12) 我们的每一个证书都可以生成一个.p12文件,这个文 ...
- 使用过redis做异步队列么,你是怎么用的?有什么缺点?
Redis设计主要是用来做缓存的,但是由于它自身的某种特性使得它可以用来做消息队列. 它有几个阻塞式的API可以使用,正是这些阻塞式的API让其有能力做消息队列: 另外,做消息队列的其他特性例如FIF ...
- XCTF csaw2013reversing2
题目描述:听说运行就能拿到Flag,不过菜鸡运行的结果不知道为什么是乱码 一.先运行看看. 果然乱码. 二.查壳 三.是pe文件,可以拖入od和ida进行动态和静态分析. 1.对主函数进行反编译一下. ...
- buu crypto 变异凯撒
一.由题目就可知是凯撒加密,但是是变异,说明有改动,但是凯撒的本质移位是不变的,将密文afZ_r9VYfScOeO_UL^RWUc,和flag进行比较,字符表查一下,发现 a:97 f:102 f:1 ...
- String、StringBuilder和StringBuffer的比较
目录 1.String特性 1.1 不可变 1.2 字符串常量池 2.StringBuilder和StringBuffer 2.1 区别 2.2 应用场景 1.String特性 1.1 不可变 它是I ...
- 去抖动 debounce
最近才发现 debounce 在 减少DOM操作及资源加载方面得重要性,遂写个博客记录一下 /** * @param {Function} func 要执行的函数 * @param {number} ...
- 支持 Homebrew 安装和编辑器模式的 flomo 命令行工具
什么是 flomo-cli 这是一款可以在命令行中将笔记和想法保存到 flomo 的工具. 基于 Golang 实现,可通过 Homebrew 便捷安装. GitHub Repo:https://gi ...
- C语言:渔夫打鱼晒网问题
//如果一个渔夫从 2011 年 1 月 1 日开始三天打渔,两天晒网,编程实现当输入 2011 1 月 1 日以后的任意一天,输出该渔夫是在打渔还是在晒网. #include <stdio.h ...