We assume the project is on one server and the repository is another. We are going to use SSH as our transfer. The SVN server and client packages are loaded and configured.
First, prepare the directory structure on the repository.
svnadmin create --fs-type fsfs /svnrepos/targetEverything else is done from the project server.
Establish connection between project server and repository.
vi ~/.ssh/configTest it:
host websvn
hostname websvn # resoled in /etc/hosts
port 22 # relocate if public
user svnuser # change as needed
IdentityFile ~/.ssh/svnuser_id_rsa
ssh websvn uptime
Use a dummy directory to create the repository skeleton.
cd /tmp; mkdir /tmp/target; cd /tmp/target
mkdir trunk branches tags
svn import -m "Initilize" . svn+ssh://websvn/svnrepos/target
Delete the dummy.
cd ~; rm -rf /tmp/target/
Move to the project's root and do a checkout against the empty repository.
cd /var/www/target/If you get an error, you forgot the dot in the SVN command.
# never trust anyone... backup! backup! backup!
tar czf /tmp/emergency.tgz *
svn co svn+ssh://websvn/svnrepos/target/trunk .
ls -ld .svn
Add the directories and check in the pre-existing files.
svn add ./*
svn ci -m "Inplace import"
Use your WebSVN interface to confirm the files are in the repository.
No comments:
Post a Comment