10 Nov 09

Here I am going to talk about three useful and handy subcommands  of svnadmin that will help us in dumping our data and restoring it back to fresh repository, restore is very critical, as we keep on backing up data but we seldom bother about restoring it to check if everything is working fine or not. I would like to put one point across that your backup is as good as your last restore.

Dumping the repository

>>svnadmin dump /srv/svn/test > backup.dump
* Dumped revision 0.
* Dumped revision 1.
* Dumped revision 2.
* Dumped revision 3.
* Dumped revision 4.
* Dumped revision 5.
* Dumped revision 6.
* Dumped revision 7.
* Dumped revision 8.
* Dumped revision 9.
* Dumped revision 10.
* Dumped revision 11.
* Dumped revision 12.
* Dumped revision 13.

This is the simplest option for dumping the repository for purpose of backing up your repository. If you want to do an incremental back than you need to specify –incremental flag and give start and end revision for same.

Restoring the repository back

E:\mywork\prolific_prolific_20091110165216>svnadmin load /srv/svn/newrepo <  backup.dump
<<< Started new transaction, based on original revision 1
* adding path : branches … done.
* adding path : documents … done.
* adding path : tags … done.
* adding path : trunk … done.

——- Committed revision 1 >>>

<<< Started new transaction, based on original revision 2
* adding path : documents/test.txt … done.

——- Committed revision 2 >>>

<<< Started new transaction, based on original revision 3
* editing path : documents/test.txt … done.

Verify the restore

>>svnadmin verify /srv/svn/newrepo
* Verified revision 0.
* Verified revision 1.
* Verified revision 2.
* Verified revision 3.
* Verified revision 4.
* Verified revision 5.
* Verified revision 6.
* Verified revision 7.
* Verified revision 8.
* Verified revision 9.
* Verified revision 10.
* Verified revision 11.
* Verified revision 12.
* Verified revision 13.

Habit of restoring the data regularly is very important for having usable backup.


Filed under: OpenSource

Trackback Uri