Brian Frost
Brian Frost

Reputation: 13454

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?

Upvotes: 5

Views: 2275

Answers (3)

yms
yms

Reputation: 10418

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.)

Upvotes: 3

Peter Parker
Peter Parker

Reputation: 29705

You can do this for FSFS repositories without any problems, as long as the subversion version on the new computer is at least the same version. disable write access while you copy the files.

See also my answer to this question

Upvotes: 0

ziesemer
ziesemer

Reputation: 28687

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.)

Upvotes: 6

Related Questions