There are only few easy steps to migrate svn repository. This post is for my own notes, in case i forget how to migrate svn repository again!
Below is the steps to migrate SVN repository:-
Advertisements
- Start your terminal
-
$ svnadmin dump /path/to/your/repo > yourreporname.dump
-
$ scp yourreponame.dump username@new.machine.ip:/path/to/your/new/repo
This steps is to transfer your dump file to your new machine. You will prompt to enter password for the new machine.
- Now your SVN dump file should be in new machine
- Login to your new machine
-
cd /path/to/your/new/repo
-
svnadmin create reponame
-
svnadmin load reponame < yourreponame.dump
- Done, you just just migrated your svn repository
* If you dump file is too big for transfer, you can compress it using tar before sending over thru network.
Tar command for compress:
tar -zcf yourreponame.tgz yourreponame.dump
Tar command for uncompress:
tar -zxf yourreporname.tgz
Related posts:
How to convert Keynote (.key) to Power Point (ppt)
Word cannot start the spelling checker - Word 2011
How to downgrade to PHP 5.2 using MacPort
How to crop image in Mac OS X
How to use apt to list available packages?
How to install apache, php, mysql with macport in Mac OS X
How to change trackpad reverse scrolling in Mac OS X Lion
How to block all file access except one using .htaccess
Share this with your friends:-
Nice summarized content..helped in saving a lot of time in bringing my task to closure..thanks a ton
Great article, I just used it to migrate from svn 1.1 on an old server to 1.7 on a new one. Everything seems good.
In response to other comments, one way to deal with large dumps is to transfer them directly over the network. This is what I did:
Create the repo on the new server:
me@newserver$ svnadmin create /path/to/new/repo
And then transfer from the old to the new with ssh:
me@oldserver$ svnadmin dump /path/to/old/repo | ssh me@newserver sudo svnadmin load /path/to/new/repo
This puts the output of the dump (on the old server) to standard output, which is then piped to the ssh command, which is then directed to standard input of the load command.
Hi,
I have a large dump file (100 GB), what is a best way to filter out / decrease the size. AFAIK removing old revisions isnt a safe way.
Please guide.
Thanks,
Thnx for the tips. Saved me time.
Since the dump is only a single file, you do not need tar.
You could even add the gzip compression to the dump command:
svnadmin dump /path/to/your/repo | gzip -c > yourreporname.dump.gz
And load it to the new server with:
gzip -cd yourreporname.dump.gz | svnadmin load reponame
Or use bzip2 instead of gzip; slower, but better compression. May be an issue when transfering the large file to the new machine.
great article. saved me a lot of time. thx very much!
Thank you. Very useful. Made my job very simple and effective.
Thanks a lot! Very helpful.
Thank you very much, my friend.
thanks doug schlenker for the correction!
small typo:
scp yourreponame.dump username:new.machine.ip:/path/to/your/new/repo
should be:
scp yourreponame.dump username@new.machine.ip:/path/to/your/new/repo