top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How to backup my SVN repositary

+1 vote
461 views

I am confused on how to backup my repositary. There is an /export/svn directory that holds all the projects directories, hook, format lock, db etc... its about 14 GB

I did do a svnadmin dump /export/svn > /test/file.dump

and I get a very small file, I restored it and it consists of hook, format, lock, db, conf and its about 304 KB
What am I doing wrong?

posted Oct 7, 2013 by Jagan Mishra

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

2 Answers

+1 vote

A dump shouldn't ever contain the hooks-directory or format file because normally those are not stored within a repository and dump only dumps repo contents. If you get a small file with those files and dirs, you probably dumped a repo with unusual content and the other project data is in other repos underneath your svn dir.

You can make sure using ls in a shell on level export or export/svn and svn ls on level export/svn and post at least part of the output here.

answer Oct 7, 2013 by Sonu Jindal
+1 vote

Note: Making a raw file-level backup of a SVN repository is not advisable. There may be open files, files that changed while the backup is running, etc. So you will need to use one of the hotcopy / dump methods to get a good "snapshot" of the repository state for inclusion onto a backup tape/disk/set.

If you want to backup everything, including server-side hook scripts and the like which are stored under the repository directory, take a look at "svnadmin hotcopy". It's essentially an rsync (but not quite) of the origin repository directory. The hotcopy directories (since they only change once per day, or whenever you do the hotcopy) are ideal for being used to backup the repository.

http://svnbook.red-bean.com/nightly/en/svn.ref.svnadmin.c.hotcopy.html

The "svnadmin dump" is more suitable for long-term archival of the SVN repository because it stores the data in platform-neutral format. It will be much larger then the original repository was (even with gzip -5) and will take a long time to perform the dump.

http://svnbook.red-bean.com/nightly/en/svn.ref.svnadmin.c.dump.html

The third option is to run a hot-spare system using the svn sync. Except that this does not give you generational backups, so you still need to use either hotcopy/dump as well.

http://svnbook.red-bean.com/nightly/en/svn.ref.svnsync.html

Personally: I prefer hotcopy for daily backups, then using rdiff-backup to make a backup of the hotcopy directory or our main backup server. The rdiff-backup step gives me the ability to go back to any day within the past 26 weeks (configurable). Combined with the use of generational media, I have multiple copies of the rdiff-backup target directory.

(rsnapshot would also be a good choice.)

I'll also make svnadmin dumps every few months, but it takes a long time to do, uses up a lot of disk space (3x for us) and has few advantages compared to the rdiff-backup of the hotcopy directory.

answer Oct 8, 2013 by anonymous
Similar Questions
+2 votes

When I was using MS windows I used a program Karen' Replicator. Is there similar sort of program in ubuntu?

0 votes

I am using subversion (version 1.9.4 (r1740329)) on centos 6..6
have created empty repository. and restored backup (hotcopy)
after restoring backup I am getting following error

Cant read file /svn/test/db/uuid: End of file found

tried searching for such errors but searches found refer to db/current or db/txn-current
I can not use any option svnadmin setuuid or svnlook uuid

How to resolve this issue ?

0 votes

I have one server contains the backup deamon and blockstore. I need to know if I can store the snapshots on tapes as off site backup. If not anyone can suggest a solution for off site backup for this situation.

...