Skip to content

Instantly share code, notes, and snippets.

@katopz
Last active August 29, 2015 14:12
Show Gist options
  • Save katopz/014a0a684a1737e50a0d to your computer and use it in GitHub Desktop.
Save katopz/014a0a684a1737e50a0d to your computer and use it in GitHub Desktop.
# your svn folder should be at root like /svn
# to use at your terminal : bash migrate.sh OLD_SVN_URL REPO_NAME
# e.g. : bash migrate.sh http://foo/svn bar
export OLD_SVN_URL=$1
export REPO_NAME=$2
cd /svn
svnadmin create ${REPO_NAME}
chown -R apache.apache ${REPO_NAME}
cd /svn/${REPO_NAME}/hooks
# Create the simplest hook possible
echo '#!/bin/sh' > pre-revprop-change
echo 'exit 0' >> pre-revprop-change
# Check that it looks correct
cat pre-revprop-change
# Looks good, now make it executable
chmod a+x pre-revprop-change
# Check the permissions
ls -al pre-revprop-change
# Run it, to make sure it runs, and check the error code
./pre-revprop-change
echo $?
touch pre-revprop-change
# Sync
svnsync init file:///svn/${REPO_NAME} ${OLD_SVN_URL}/${REPO_NAME}
svnsync synchronize file:///svn/${REPO_NAME}
# UUID TODO : find automatically way to set uuid
echo "Don't forget to manually change UUID e.g. : svnadmin setuuid /svn/${REPO_NAME} your-old-repos-uuid-go-here"
svn info ${OLD_SVN_URL}/${REPO_NAME}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment