Archive for the ‘subversion’ Category

Script to Backup SVN Repository

February 23, 2012 1 comment

This is a script to backup my svn repositories:


# On this script I'm assuming that in the backup path 
# we only have .gz files so I use the same direcotry 
# as temp folder to dump the files there and gzip 
# them later

# Configuration
#repository's names blank space separated
REPO_NAME_LIST="one two website source code"

# Check that there are no running backups
if [ -f $LOCKFILE ]; then
	echo "Instance already running"
	exit 1

# Create the lock file to prevent multiple runs

if [ ! -d ${REPO_PATH}/${REPO_NAME} ]; then
	echo "Repository Path: ${REPO_PATH} not found."
	exit 1

# First lets create the dump files
	echo "Checking repository: ${REPO_NAME} ..."
	if [ -d ${REPO_PATH}/${REPO_NAME} ]; then
		svnadmin dump -q ${REPO_PATH}/${REPO_NAME} > ${BKP_PATH}/${REPO_NAME}.dump
		echo "${REPO_NAME} dumped."
		echo "Repository ${REPO_NAME} not found."

#Now lets create the tar file
if [ ${FLAG} -eq 1 ]; then
	PREFIX_FILENAME=`date +"%y-%m-%d_%H%M"`
	cd ${BKP_PATH}
	tar -zcf ${PREFIX_FILENAME}.tar.gz *dump
	rm *dump

echo "Script Finished"
exit 0
Categories: backup, scripts, subversion

Upgrade to subversion 1.7.3

February 23, 2012 1 comment

Well, now that the version 1.7.3  of subversion was released let’s do a quick upgrade, I’m not going to paste here the steps to backup since they are already included here. Please always backup your stuff, it doesn’t take longer than the time you will have to spend if anything goes wrong and your info got corrupted or lost.

Now, lets download and prepare all we need.

tar zxf subversion-1.7.3.tar.gz
cd subversion-1.7.3
tar zxf apr-util-1.4.1.tar.gz
tar zxf apr-1.4.6.tar.gz
mv apr-util-1.4.1 apr-util
mv apr-1.4.6 apr

Then since I’m using svnserve I have to kill the running version:

ps -fea | grep svnserve | grep -v grep | awk '{print $2}' | xargs kill -9

And Finally, lets compile and install.

make install
svn --version #You should see the 1.7.3 now
Categories: subversion

Upgrade subversion to version 1.7 on CentOS

February 11, 2012 6 comments

Hi, this time I wanted to upgrade subversion on my CentOS box. So this is what I did:

First of all, take backup of your existing repositories (Assuming that I have a repository named: code and it is configured on svn under /home/svn/repositories/code):

svnadmin dump /home/svn/repositories/code > /backups/svn/code.dump

Now lets kill our running svn server:

ps -fea | grep svnserver
ps -fea | grep svnserve | grep -v grep | awk '{print $2}' | xargs kill -9

Now that I have my backups ready and the server is stopped I can go ahead and uninstall current svn version and then build from source and install the latest version, with these steps:

svn --version #Lets check which version we have now

yum remove subversion

cd /usr/local/src/

wget #got this from on the recomended download section

tar zxf subversion-1.7.2.tar.gz # Make sure you use the same filename from the previous step

cd subversion-1.7.2



tar zxf apr-util-1.3.12.tar.gz

mv apr-util-1.3.12 apr-util # When using ./configure it will look for these files by default on a folder without version number

tar zxf apr-1.4.5.tar.gz

mv apr-1.4.5 apr # When using ./configure it will look for these files by default on a folder without version number


Now after my first try to get this working, it failed because of the sqlite version, so if you get this message after trying ./configure :

checking sqlite library version (via header)... unsupported SQLite version
checking sqlite library version (via pkg-config)... none or unsupported 3.3

An appropriate version of sqlite could not be found. We recommmend, but require at least 3.6.18.

Then you would need to install sqlite 3.7.X you can do it by installing atomic repository and updating using yum:

sqlite3 -version #check current version

wget -q -O - | sh # To install Atomic repository

yum --enablerepo=atomic upgrade sqlite

sqlite3 -version #you should get the 3.7 version listed now

Now that we have the updated sqlite, lets continue with the subversion install:



make install

svn --version # Now you should see the latest version

Now, go to all of your local working directories and do a svn upgrade:

cd /application/code

svn upgrade

And Thats it!! You now have the 1.7 svn working version.

Categories: subversion Tags: , ,