Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I copy an SVN repository between machines using an exact file copy?

I have a large repository on a Windows machine. I would like to copy this entire repository on to another machine, ideally without going via 'dump' or using svnsync. If I can GUARANTEE that no file is changed during the copy process, can I simply make an exact file copy on the second machine using tradition file copying techniques?

like image 475
Brian Frost Avatar asked Nov 23 '11 17:11

Brian Frost


2 Answers

If you're using the Berkeley DB repository storage, then you do need to be very careful - including matching of versions, and even OS. However, if you're using the Fast Secure File System (FSFS, currently the default on any new repositories), it is VERY portable. I do this regularly, and haven't had any issues copying the repository between systems, including Linux <-> Windows, and even between Subversion 1.6 and 1.7. (Just watch the Subversion release notes if you are crossing Subversion versions.)

like image 72
ziesemer Avatar answered Oct 23 '22 00:10

ziesemer


If you have exactly the same version for subversion in both systems, it should be OK. I have done this before without facing any issues.

Even with different versions, it is still supposed to work, from svn book:

There are many reasons for dumping and loading Subversion repository data. Early in Subversion's life, the most common reason was due to the evolution of Subversion itself(...). Now, these types of schema changes haven't occurred since Subversion's 1.0 release, and the Subversion developers promise not to force users to dump and load their repositories when upgrading between minor versions (such as from 1.3 to 1.4) of Subversion.

For your specific situation (version 1.6 vs 1.7) there is a paragraph in the release notes for version 1.7 that clarifies the situation:

Subversion 1.7 servers use the same repository format as Subversion 1.6. Therefore, it is possible to seamlessly upgrade and downgrade between 1.6.x and 1.7.x servers without changing the format of the on-disk repositories. (This is not correct in general for any pair of 1.x and 1.y servers, but happens to hold for 1.6 and 1.7.)

like image 24
yms Avatar answered Oct 22 '22 22:10

yms