boards > tech > Moving a subversion project from one repository to another

ownericonuserlame
Joined: 2004-03-17
Posts: 653
2008.06.04 - 16:05:04 PDT
Assume you have a repository in file:///home/repos/my_repo on box1. Also assume there are two projects inside: /proj1 and /proj2.

Say on box2 we have a repository in file:///home/repos/other_repo, and we'd like to move proj2 over there. The following will do so:

[svnuser@box1]$ svnadmin dump /home/repos/my_repo |svndumpfilter include proj2 >proj2.dump

I'm going to move my project from /proj2 on box1's repo to /proj2 on box2's repo, so the Node-paths will stay the same. If I was renaming it to say /newproj2 on box2's repo, at this point I'd run:

[svnuser@box1]$ sed -i 's/Node-path: proj2/Node-path: newproj2/g' proj2.dump

Either way, then move proj2.dump over to box2, and on box2:

[svnuser@box2]$ svnadmin load /home/repos/other_repo < proj2.dump

That's going to run through every transaction your project has gone through, so it will take a little while. Keep this in mind when making your dump as well...it's going to take up storage for every revision of your project. That can be an issue on more mature projects.

But, there you have it. The project is now available on box2 at file:///home/repos/other_repo/proj2.
hit counter