What is the best practice of taking SVN backups?

Saqib Khan's picture
Saqib Khan asked on November 25, 2010 - 2:29pm | Replies (11).

What is the best practice of taking SVN backups, i.e. either through dumps using a script or copying the whole database using Windows System tools or any other good practice?

1 Comment

what is the best practise to take svn repos backup in linux if repos size are huge size say exmaple 

 

ttoal 100 repo size is 2 TB and we need this script and whethere we have t o use svnadmin hotcopy or sanadmin dump command 

11 Answers

Biplab's picture
Biplab replied on November 26, 2010 - 2:13am.

I would suggest that you take a full dump of the SVN repository once a week with the svn dump command, and incremental dump on a daily basis again with the svn dump command with incremental parameter. Again, its a good practice to load the dump from time to time in order to check the integrity of the dump and make sure that nothing is messed up.

Alok's picture
Alok replied on November 26, 2010 - 2:14am.

Hi,

You can use "svn admin hotcopy" to take the backup.
It will save the configuration files and properties of the repository along with the data.

Also, it is fast and take less size than "svn dump"

Regards,
Alok

Saqib Khan's picture
Saqib Khan replied on November 27, 2010 - 2:06pm.

Is there any other option for taking backup like for example going for replication of the database to another server?

Alok's picture
Alok replied on November 29, 2010 - 4:27am.

Yes,

You can go for "svn sync"

It will create a mirror of the repository wherever you want and then you can sync up your repos with the server repos.

Note: You can add this command in a script and can invoke it either on daily basis or on every commit with the help of hooks.

Saqib Khan's picture
Saqib Khan replied on November 29, 2010 - 5:31am.

Yes, moreover you also use mirroring software too for taking the replica of SVN database.

Thanks!

vinnyjames's picture
vinnyjames replied on November 29, 2010 - 3:54pm.

There are commercial products to provide an always on / always up to date copy of your repositories as well. With a failover agent / load balancer you can ensure extremely high SLAs.

http://wandisco.com/subversion/clustering/

Saqib Khan's picture
Saqib Khan replied on November 29, 2010 - 8:52pm.

Thanks for this information. Yes, I checked and find quite expensive packages but if we are quite confident about the integrity of our backups than I think there is no problem in purchasing too.

TechWell Contributor's picture

I used svn admin hotcopy to make backups of a repository, and the one time I had to restore, I simply copied that hotcopy straight off a DVD into my repositories folder, and voila, I had a working repository.

If you're looking for a cheap solution, you might combine a scheduled batch hotcopy with a cloud-based backup like Mozy.

Saqib Khan's picture
Saqib Khan replied on December 8, 2010 - 9:28pm.

@ gpinzone,
Using the above code for DB Dump, can you tell me that a repository having a size of 5 GB, what should be the estimated size after taking DB Dump? If I say the DB Dump size is about 5.3 GB, i.e. more than the actual database size than how we can reduce its size, any possibility?

Gerard Pinzone's picture

The dump is much larger than the actual database. However, compressing it using gzip cuts the size down by 1/5.

Marcia Rocha's picture

Hello

We have Subversion 1.8 and we do backup using a tool that do backup from filesystem directly.

I did not do using svn dump.

I think if I need to restore, it just to restore from backup the directory related to my repository.

 

Is it correct? Is there any problem if I do backup using this method since svn dump?

 

best regards

MArcia

CMCrossroads is a TechWell community.

Through conferences, training, consulting, and online resources, TechWell helps you develop and deliver great software every day.