copying a directory of repositories to another server
CentOS 5.3
I have a directory called repos. Inside that directory I have repositories and subdirectories of repositories. There are more than 30 repositories in all.
We are now moving our repositories to another server. I am just wondering what is the best way to copy all the repositories.
I have looked at svnadmin dump and hotcopy. However, I would like to copy all the repositories recursively. I am not sure that dump and hotcopy allow you to copy all the directories.
I could use hotcopy. However, that would take forever if I have to do them one at a time.
Would it be safe to do a just a normal file copy 开发者_如何学运维i.e. scp -r source dest
Many thanks for any suggestions,
Yes you can very well do a scp from source to destination. you might just need to make the appropriate configuration/commandline changes while starting svn.
I could use hotcopy. However, that would take forever if I have to do them one at a time.
You can try to use bash scripting:
for d in /srv/svnroot/* ; do svnadmin dump $d | ssh targetserver svnadmin load $d ; done
Where /srv/svnroot
is your directory with the svn repositories and targetserver
you new server.
I would not really recommend scp
, it works only with FSFS repositories and you have to make sure that nobody can access them while you copy.
I found another way.
Which is using rsync. That is what I did and it worked ok.
rsync -rcaz -e ssh source@xx.xx.xx.xx:/svn_repos dest@xx.xx.xx.xx:/svn_repos
精彩评论