How would I get a full copy of an SVN repository and import it on another server?
3 Answers
You want to perform an svnadmin dump
. You can get help on this command via svnadmin help dump
or reading the docs. You can then load the dump file into your new server using svnadmin load
.

- 25,504
- 18
- 62
- 103
If you don't have access to the physical server (and the server runs Subversion 1.4 or later) you could use svnsync to create a local copy of the complete repository.
After that you can use svnadmin to create a dumpfile from your local copy.
See also How do I create a dump file from my subversion hosting account?

- 1
- 1

- 19,525
- 4
- 57
- 73
It depends on the repository type. If you're using fsfs, you can just copy the directory after stopping the server (to make sure you don't copy a transaction which is half completed). I've done that before and it worked flawlessly.
If you're using bdb
you should do an svnadmin dump
instead. (If the old and new computers are similar in terms of architecture and OS you may well just get away with a directory copy, but dumping the repository would be safer.)

- 1,421,763
- 867
- 9,128
- 9,194
-
if you just copy the directory using the OS file copy command, you run the risk of corruption. You can use "svnadmin hotcopy" to perform a copy as you describe without the risk of corruption. The dump/load cycle is usually preferred however, as it allows for loading into a different version of SVN – rmeador Apr 01 '09 at 16:13
-
Would probably work, though I would probably be worried about it for days. svnadmin dump seems like a more reliable solution. – Andrei Serdeliuc ॐ Apr 01 '09 at 16:13
-
1@rmeador: Assuming you stop the server first (which I'll edit my answer to mention) why do you risk corruption? What could go wrong? – Jon Skeet Apr 01 '09 at 16:16
-
1If the repo isn't in use, I think you're safe. Using "svnadmin hotcopy" is just The Right Way according to the SVN developers, especially if the repo is in use. – rmeador Apr 01 '09 at 16:42