Tuesday, February 16, 2010

How to copy SVN repository from one machine to another?

How to copy SVN repository from one machine to another?

SVN repository can be moved from one machine to another without considering the change in version numbers. The following are the steps to do that.

1. Dump the whole repository.

a. Check the latest revision in the SVN

Command: svnlook youngest REPOS_PATH

Example: svnlook youngest /opt/UNICODESVNREPOS

b. Dump the repository until the latest revision.

Command: svnadmin dump REPOS_PATH > DUMP_TEXT_FILE

Example: svnadmin dump /opt/UNICODESVNREPOS > UNICODESVNREPOS_dump.txt

2. Load the dumped repository to the new repository.

a. Create a new repository.

Command: svnadmin create [Options] REPOS_PATH

Example: svnadmin create --fs-type fsfs UNICODESVNREPOS

b. Load the repository with the dump.

Command: svnadmin load REPOS_PATH <>

Example: svnadmin load UNICODESVNREPOS <>

This is a simple way to do the processing at the whole repository level. Processing with each projects in the repository is also possible. An additional command is required to do this process and that specific command is “svndumpfilter”.

References:

http://svnbook.red-bean.com/en/1.4/index.html

http://svnbook.red-bean.com/en/1.4/svn.reposadmin.maint.html

No comments: