<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Rohland de Charmoy &#187; Uncategorized</title>
	<atom:link href="http://www.rohland.co.za/index.php/category/uncategorized/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.rohland.co.za</link>
	<description>Pushing buttons...</description>
	<lastBuildDate>Sat, 04 Feb 2012 16:01:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Backup your Subversion repository offsite (Windows Guide)</title>
		<link>http://www.rohland.co.za/index.php/2010/02/01/backup-your-subversion-repository-offsite-windows-guide/</link>
		<comments>http://www.rohland.co.za/index.php/2010/02/01/backup-your-subversion-repository-offsite-windows-guide/#comments</comments>
		<pubDate>Mon, 01 Feb 2010 17:59:34 +0000</pubDate>
		<dc:creator>Rohland</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[offsitebackup]]></category>
		<category><![CDATA[powershell]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.rohland.co.za/?p=166</guid>
		<description><![CDATA[If you work in a development environment, theres a good chance you are using Subversion as your code repository of choice. If thats the case, the usual suggestion for backing up is to dump the repositories onto a DVD or external drive to be stored offsite. We have been doing this for a while and [...]]]></description>
			<content:encoded><![CDATA[<p>If you work in a development environment, theres a good chance you are using <a href="http://subversion.tigris.org/" target="_blank">Subversion</a> as your code repository of choice. If thats the case, the usual suggestion for backing up is to dump the repositories onto a DVD or external drive to be stored offsite. <a href="http://www.clyral.com" target="_blank">We</a> have been doing this for a while and have found the process painfull (to say the least!). If you run subversion and don&#8217;t have your data backed up frequently offsite, you might find yourself pushing <a href="http://www.nooooooooooooooo.com/" target="_blank">this button</a> sooner or later! </p>
<p>Near the end of last year I started looking at offsite backup options that didn&#8217;t require user intervention and was very excited to discover the <a href="http://svnbook.red-bean.com/en/1.5/svn.ref.svnsync.html" target="_blank">svnsync</a> command. The benefit of svnsync is that only new revisions are mirrored and not the full repository each time. This is absolutely critical if you have a repository that is quite active. Needless to say, I decided to forge ahead and try my hand at implementing automated scripts to take care of backing up our repositories online utilising the svnsync tool. As a reference I have posted the setup process here.</p>
<p>Its important to note that this guide assumes you are working in a Windows environment and that you have access to a server offsite. I have referenced a few articles and other blog posts I discovered along the way to help you if you are working in a Linux environment.</p>
<div style="padding-left:30px">
<p><strong>Step 1 &#8211; Setup Subversion on your remote server</strong></p>
<p>Create a Windows user account on your remote server which you will use to remotely access the backup repository from your main Subversion server. Take note of the account name and password you use. Once you have created the account, install <a href="http://www.visualsvn.com/server/download/" target="_blank">Visual SVN</a> on the server where you want to host your mirrored repositories. Ensure you select Windows Authentication on the security dialog during the installation process. Once completed, ensure that Subversion is running correctly on the remote machine by opening the VisualSVN manager and clicking on the repository address displayed. Now ensure you can access the repository from your host Subversion server. If your backup server&#8217;s name is not addressable from your host server, use the remote servers IP address or simply add an entry to your DNS server or Windows <a href="http://en.wikipedia.org/wiki/Hosts_file" target="_blank">host file</a>. If you opted for setting up a DNS entry, you should be able to ping your backup server using the server&#8217;s name. Try access the repository again. When prompted for username and password use the credentials setup for the user account you created.</p>
<p><strong>Step 2 &#8211; Configure permissions</strong></p>
<p>Before setting up the repositories etc. we need to define which users have access writes to the backup repository. To configure this, open VisualSVN manager on the remote server and right click on the Repositories folder, choose Properties from the drop down menu. Revoke all access for the BUILTIN\Users role and then add the user account you setup in Step 1. Ensure this user has full Read/Write access.</p>
<p><strong>Step 3 &#8211; Create the destination repository</strong></p>
<p>Now that you have full configured the Subversion server hosted on your remote server we can start the process of setting up the synchronisation process. To do this we need to ensure that we have a destination repository to mirror your existing repository to (if you have more than one you need to create a destination repository for each repository you want to mirror). To keep things simple, I gave the destination repository the same name as the source repository. Take note that any repository you create on the destination server should be empty (i.e. do not tick the &#8220;Create default structure&#8221; checkbox when creating the repository.</p>
<p><strong>Step 4 &#8211; Configure the repository</strong></p>
<p>The next step involves setting the Pre-revision Property Change Hook. This is an important step. Right click on the repository you created on the destination server and select All Tasks > Manage Hooks. Click on the &#8220;Pre-revision property change hook&#8221; entry and click Edit. Enter a few blank lines and click OK and Apply.</p>
<p><strong>Step 5 &#8211; Configure SSL</strong></p>
<p>We need to configure the client server to accept the SSL certificate generated by the VisualSVN installer. If you wish to use a properly signed certificate or already have one, follow this <a href="http://www.visualsvn.com/support/topic/00034/" target="_blank">guide</a> and ignore the rest of this step. If you want to continue using the auto generated certificate, follow Mark Wilson&#8217;s <a href="http://www.markwilson.co.uk/blog/2008/11/trusting-a-self-signed-certificate-in-windows.htm" target="_blank">guide</a> on how to trust the default certificate.</p>
<p><strong>Step 6 &#8211; Initialise your repositories for synchronisation</strong></p>
<p>Before you can synchronise your repository, you need to initialise it. To do this, you need to run the following command on the host server (note that you need to replace the keys in CAPS to the relevant object names):</p>
<p><font color="#377400">svnsync init PATH_TO_REMOTE_REPO PATH_TO_LOCAL_REPO &#8211;sync-username REMOTE_USERNAME  &#8211;sync-password REMOTE_PASSWORD &#8211;source-username HOST_USERNAME &#8211;source-password HOST_PASSWORD</font></p>
<p><strong>Step 7 &#8211; Initialise remote repositories from a previous backup</strong></p>
<p>Only run through this step if you have a relatively large repository and don&#8217;t want to have to mirror it (the sync process is quite slow) from revision 0 all the way to revision xxxx. If you are running through these steps for a brand new repository you want to have mirrored, ignore this step. Also, please take note that if you are using Powershell to execute all these scripts &#8220;>&#8221; is equiv to | Out-File -encoding Unicode (thanks <a href="http://twitter.com/r_keith_hill/status/8347225922" target="_blank">Keith</a>). If you don&#8217;t be careful, you might end up with the <a href="http://brianlyttle.com/2009/01/powershell-and-svnadmin/" target="_blank">Malformed dumpfile header</a> error. To be safe, use the command line interface.</p>
<p>Dump your existing repository on your host machine by running the following script: </p>
<p><font color="#377400">svnadmin dump &#8220;FILE_PATH_TO_REPO&#8221; > &#8220;REPO_NAME.db&#8221;</font></p>
<p>Once the repository dump has completed, upload it to your backup server and then run the following script on the backup/mirros server: </p>
<p><font color="#377400">svnadmin load &#8220;FILE_PATH_TO_BACKUP_REPO&#8221; < "REPO_NAME.db"</font></p>
<p>Now, the next step is critical. You need to update the last-merged-rev property on the remote repository to the existing revision number of the repository (you can get this information by running &#8220;svn info REPO_PATH&#8221;). To do this run the following script: </p>
<p><font color="#377400">svn propset svn:sync-last-merged-rev &#8211;revprop -r0 REV_NUMBER &#8220;PATH_TO_REMOTE_REPO&#8221;.</font></p>
<p><strong>Step 8 &#8211; Synchronise!</strong></p>
<p>Basically you are done, you simply need to run the following script on a frequent basis (best to setup as a scheduled task in Windows):</p>
<p><font color="#377400">svnsync sync PATH_TO_REMOTE_REPO &#8211;sync-username REMOTE_USERNAME  &#8211;sync-REMOTE_PASSWORD &#8211;source-username HOST_USERNAME &#8211;source-password HOST_PASSWORD</font></p>
</div>
<p>Hope you found this useful. I might follow this post up with another blog entry on steps I took to setup an automated script to email me when a repository on the host machine is missing its mirrored counterpart. This is really helpful to detect cases where a repository was setup locally but not configured for synchronisation, furthermore the ability to automatically generate the relevant scripts is quite useful <img src='http://www.rohland.co.za/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Rohland</p>
<p>References:<br />
<a href="http://journal.paul.querna.org/articles/2006/09/14/using-svnsync/" target="_blank">http://journal.paul.querna.org/articles/2006/09/14/using-svnsync/</a><br />
<a href="http://www.rosshawkins.net/archive/2009/04/27/using-svnsync-properwith-visualsvn.aspx" target="_blank">http://www.rosshawkins.net/archive/2009/04/27/using-svnsync-properwith-visualsvn.aspx</a><br />
<a href="http://devlicious.com/blogs/christopher_bennage/archive/2009/03/11/mirroring-subversion-from-windows.aspx" target="_blank">http://devlicious.com/blogs/christopher_bennage/archive/2009/03/11/mirroring-subversion-from-windows.aspx</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.rohland.co.za/index.php/2010/02/01/backup-your-subversion-repository-offsite-windows-guide/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Blog Migration</title>
		<link>http://www.rohland.co.za/index.php/2009/10/11/blog-migration/</link>
		<comments>http://www.rohland.co.za/index.php/2009/10/11/blog-migration/#comments</comments>
		<pubDate>Sun, 11 Oct 2009 17:42:04 +0000</pubDate>
		<dc:creator>Rohland</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.rohland.co.za/?p=58</guid>
		<description><![CDATA[In search of a bit more flexibility, I have decided to move my existing blog at dotnet.org.za to www.rohland.co.za. For lack of a better name, I ended up with the obvious pretentious default I am very grateful for the service made available via the dotnet.org.za portal. A year ago it allowed me to get up [...]]]></description>
			<content:encoded><![CDATA[<p>In search of a bit more flexibility, I have decided to move my existing blog at <a href="http://dotnet.org.za">dotnet.org.za</a> to <a href=''>www.rohland.co.za</a>. For lack of a better name, I ended up with the obvious pretentious default <img src='http://www.rohland.co.za/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p>I am very grateful for the service made available via the <a href="http://dotnet.org.za">dotnet.org.za portal</a>. A year ago it allowed me to get up and running with my blog relatively quickly. To the administrators of the portal &#8211; thank you! </p>
<p>In terms of moving forward, I was not sure what the correct procedure for moving my existing blog away from <a href="http://dotnet.org.za">dotnet.org.za</a> was, so I ended up implementing a simple script to redirect to my new domain. Hopefully, I will be able to organise a mechanism whereby future posts here reflect in the dotnet.org.za main feed. If not, then I guess that is the penalty for moving my blog.</p>
<p>Hopefully you subscribe to the RSS feed available <a href='http://www.rohland.co.za/index.php/feed/'>here</a>, or at the very least, check back periodically for new content. Please let me know if spot any issues.</p>
<p>If you have landed here after clicking a link related to one of my older blog posts, simply use the search feature available in the side bar to locate the content you were originally hoping to review.</p>
<p>Cheers,<br />
Rohland</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rohland.co.za/index.php/2009/10/11/blog-migration/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
	</channel>
</rss>

