<?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>eXpand yOur cReativity &#187; Subversion</title>
	<atom:link href="http://blog.bhushangahire.net/category/subversion/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.bhushangahire.net</link>
	<description></description>
	<lastBuildDate>Thu, 05 Jan 2012 07:17:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Setup script to get Ruby and Rails running on Ubuntu with one command using RailsReady</title>
		<link>http://blog.bhushangahire.net/2011/12/05/setup-script-to-get-ruby-and-rails-running-on-ubuntu-with-one-command-using-railsready/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=setup-script-to-get-ruby-and-rails-running-on-ubuntu-with-one-command-using-railsready</link>
		<comments>http://blog.bhushangahire.net/2011/12/05/setup-script-to-get-ruby-and-rails-running-on-ubuntu-with-one-command-using-railsready/#comments</comments>
		<pubDate>Mon, 05 Dec 2011 10:29:26 +0000</pubDate>
		<dc:creator>Bhushan Ahire</dc:creator>
				<category><![CDATA[git]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[Subversion]]></category>
		<category><![CDATA[railsready]]></category>
		<category><![CDATA[server]]></category>

		<guid isPermaLink="false">http://blog.bhushangahire.net/?p=302</guid>
		<description><![CDATA[How would you like to get a full Ruby on Rails stack up on Ubuntu with one command? Now you can by running Rails Ready. Rails Ready is a setup script that gets Ruby and Rails running on a fresh install of Ubuntu with one command (Tested on Ubuntu server 10.04 LTS (Long-term Support)). This [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><div class="description">
<p>How would you like to get a full Ruby on Rails stack up on Ubuntu with one command?</p>
<p>Now you can by running Rails Ready. Rails Ready is a setup script that gets Ruby and Rails running on a fresh install of <a target="_blank" class="link external" href="http://www.ubuntu.com/">Ubuntu</a> with one command (Tested on Ubuntu server 10.04 LTS (Long-term Support)).</p>
<p>This is a brand new project by <a target="_blank" class="link external" href="https://github.com/joshfng">Josh Frye</a> that he uses all the time to setup VMs, but there’s always testing to be done and improvements to be made. </p>
<h3>Running the&nbsp;Script</h3>
<p>Check out <a target="_blank" class="link external" href="https://github.com/joshfng/railsready/blob/master/railsready.sh">railsready.sh</a> to see everything Rails Ready is doing.</p>
<pre class="brush: ruby">
  sudo wget --no-check-certificate https://github.com/joshfng/railsready/raw/master/railsready.sh &amp;amp;amp;&amp;amp;amp; bash railsready.sh
</pre>
<p>The script will then ask if you want to build Ruby from source or install RVM. If you want to watch the magic happen just run <code>tail -f ~/railsready/install.log</code>.</p>
<h3>What gets installed?</h3>
<ul>
<li>An updated system (Linux only)</li>
<li>Homebrew (OSX only)</li>
<li>Ruby 1.9.3 latest patch level (installed to /usr/local/bin/ruby) or RVM running 1.9.3 latest patch level</li>
<li>Imagemagick</li>
<li>libs needed to run Rails (sqlite, mysql, etc)</li>
<li>Bundler, Passenger, and Rails gems</li>
<li>Git</li>
</ul>
<p>All you need to do is install <a target="_blank" class="link external" href="http://nginx.org/">NGINX</a> or <a target="_blank" class="link external" href="http://www.apache.org/">Apache</a>, run <code>passenger-install-nginx-module</code> or <code>passenger-install-apache-module</code>, upload your app, point your vhost config to your apps public directory and go!</p>
<p>A note about RVM+passenger+nginx: Passenger installed via RVM can&#8217;t locate the OpenSSL package installed on Ubuntu. A user contributed fix is as follows:</p>
<pre class="brush: ruby">
rvm remove 1.9.2
rvm package install openssl
rvm install 1.9.2 --with-openssl-dir=$HOME/.rvm/usr
rvmsudo passenger-install-nginx-module
</pre>
<p>Hope this guide will be helpful to you.
</p></div>
<div class="shr-publisher-302"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://blog.bhushangahire.net/2011/12/05/setup-script-to-get-ruby-and-rails-running-on-ubuntu-with-one-command-using-railsready/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setup Capistrano to deploy Rails application on Amazon EC2 with Git</title>
		<link>http://blog.bhushangahire.net/2010/02/17/setup-capistrano-to-deploy-rails-application-on-amazon-ec2-with-git/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=setup-capistrano-to-deploy-rails-application-on-amazon-ec2-with-git</link>
		<comments>http://blog.bhushangahire.net/2010/02/17/setup-capistrano-to-deploy-rails-application-on-amazon-ec2-with-git/#comments</comments>
		<pubDate>Wed, 17 Feb 2010 06:22:49 +0000</pubDate>
		<dc:creator>Bhushan G Ahire</dc:creator>
				<category><![CDATA[capistrano]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Subversion]]></category>
		<category><![CDATA[ec2]]></category>
		<category><![CDATA[server]]></category>

		<guid isPermaLink="false">http://blog.bhushangahire.net/?p=155</guid>
		<description><![CDATA[1: Create a new Rails app &#8211; we&#8217;ll call is &#8216;deploytest&#8217; $ rails deploytest $ cd deploytest 2: Create a local Git repository for it $ git init $ git add * $ git commit -a -m 'initial commit' $ git status 3: Create a couple of Capistrano files $ capify . 4: Edit config/deploy.rb [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><div class="post-body entry-content">1: Create a new Rails app &#8211; we&#8217;ll call is &#8216;deploytest&#8217;</p>
<pre class="prettyprint"><span class="pln">$ rails deploytest
$ cd deploytest</span></pre>
<p>2: Create a local Git repository for it</p>
<pre class="prettyprint"><span class="pln">$ git init
$ git add </span><span class="pun">*</span><span class="pln">
$ git commit </span><span class="pun">-</span><span class="pln">a </span><span class="pun">-</span><span class="pln">m </span><span class="str">'initial commit'</span><span class="pln">
$ git status</span></pre>
<p>3: Create a couple of Capistrano files</p>
<pre class="prettyprint"><span class="pln">$ capify </span><span class="pun">.</span></pre>
<p>4: Edit config/deploy.rb</p>
<pre class="prettyprint"><span class="com"># The name of your app</span><span class="pln">
</span><span class="kwd">set</span><span class="pln"> </span><span class="pun">:</span><span class="pln">application</span><span class="pun">,</span><span class="pln"> </span><span class="str">"deploytest"</span><span class="pln">
</span><span class="com"># The directory on the EC2 node that will be deployed to</span><span class="pln">
</span><span class="kwd">set</span><span class="pln"> </span><span class="pun">:</span><span class="pln">deploy_to</span><span class="pun">,</span><span class="pln"> </span><span class="str">"/var/www/apps/#{application}"</span><span class="pln">
</span><span class="com"># The type of Source Code Management system you are using</span><span class="pln">
</span><span class="kwd">set</span><span class="pln"> </span><span class="pun">:</span><span class="pln">scm</span><span class="pun">,</span><span class="pln"> </span><span class="pun">:</span><span class="pln">git
</span><span class="com"># The location of the LOCAL repository relative to the current app</span><span class="pln">
</span><span class="kwd">set</span><span class="pln"> </span><span class="pun">:</span><span class="pln">repository</span><span class="pun">,</span><span class="pln">  </span><span class="str">"."</span><span class="pln">
</span><span class="com"># The way in which files will be transferred from repository to remote host</span><span class="pln">
</span><span class="com"># If you were using a hosted github repository this would be slightly different</span><span class="pln">
</span><span class="kwd">set</span><span class="pln"> </span><span class="pun">:</span><span class="pln">deploy_via</span><span class="pun">,</span><span class="pln"> </span><span class="pun">:</span><span class="pln">copy

</span><span class="com"># The address of the remote host on EC2 (the Public DNS address)</span><span class="pln">
</span><span class="kwd">set</span><span class="pln"> </span><span class="pun">:</span><span class="pln">location</span><span class="pun">,</span><span class="pln"> </span><span class="str">"ec2-xxx-xxx-xxx-xxx.compute-1.amazonaws.com"</span><span class="pln">
</span><span class="com"># setup some Capistrano roles</span><span class="pln">
role </span><span class="pun">:</span><span class="pln">app</span><span class="pun">,</span><span class="pln"> location
role </span><span class="pun">:</span><span class="pln">web</span><span class="pun">,</span><span class="pln"> location
role </span><span class="pun">:</span><span class="pln">db</span><span class="pun">,</span><span class="pln">  location</span><span class="pun">,</span><span class="pln"> </span><span class="pun">:</span><span class="pln">primary </span><span class="pun">=&gt;</span><span class="pln"> </span><span class="kwd">true</span><span class="pln">

</span><span class="com"># Set up SSH so it can connect to the EC2 node - assumes your SSH key is in ~/.ssh/id_rsa</span><span class="pln">
</span><span class="kwd">set</span><span class="pln"> </span><span class="pun">:</span><span class="pln">user</span><span class="pun">,</span><span class="pln"> </span><span class="str">"root"</span><span class="pln">
ssh_options</span><span class="pun">[:</span><span class="pln">keys</span><span class="pun">]</span><span class="pln"> </span><span class="pun">=</span><span class="pln"> </span><span class="pun">[</span><span class="typ">File</span><span class="pun">.</span><span class="pln">join</span><span class="pun">(</span><span class="pln">ENV</span><span class="pun">[</span><span class="str">"HOME"</span><span class="pun">],</span><span class="pln"> </span><span class="str">".ssh"</span><span class="pun">,</span><span class="pln"> </span><span class="str">"id_rsa"</span><span class="pun">)]</span><span class="pln">
</span></pre>
<p>The only account on a default EC2 instance is root. You probably want to create a second user that is responsible for your application.</p>
<p>5: Copy your SSH public key to your EC2 node</p>
<pre class="prettyprint"><span class="pln">$ scp </span><span class="pun">-</span><span class="pln">i </span><span class="pun">~</span><span class="str">/my-ec2-keypair ~/</span><span class="pun">.</span><span class="pln">ssh</span><span class="pun">/</span><span class="pln">id_rsa</span><span class="pun">.</span><span class="pln">pub root@ec2</span><span class="pun">-</span><span class="lit">xxx</span><span class="pun">-</span><span class="lit">xxx</span><span class="pun">-</span><span class="lit">xxx</span><span class="pun">-xxx</span><span class="lit">.compute</span><span class="pun">-</span><span class="lit">1.amazonaws</span><span class="pun">.</span><span class="pln">com</span><span class="pun">:</span><span class="str">/root/</span><span class="pun">.</span><span class="pln">ssh</span><span class="pun">/</span><span class="pln">authorized_keys2</span></pre>
<p>NOTE the filename authorized_keys2 &#8211; not authorized_keys!!</p>
<p>6: Setup the EC2 node for Capistrano deployment.<br />
From your LOCAL machine, not the EC2 node:</p>
<pre class="prettyprint"><span class="pln">$ cap deploy</span><span class="pun">:</span><span class="pln">setup</span></pre>
<p>7: Finally, deploy your application</p>
<pre class="prettyprint"><span class="pln">$ cap deploy</span></pre>
<p>You will see lots of output and with this dummy application some of those will report errors/warnings. Don&#8217;t worry about that for now.</p>
<p>8: Check that the Deployment was successful<br />
Connect to the EC2 node with SSH the regular way, cd to the app directory and check that everything is there. If that is all working then you are ready to deploy a real application and add custom tasks for managing the database, restarting the server etc.</p>
<p>Bear in mind that Capistrano add new &#8216;releases&#8217; of your software in separate directories and symlinks the &#8216;current&#8217; directory to the latest. So the root of your deployed application is the &#8216;current&#8217; subdirectory.</p>
<p>Hope this will help you setting up your ec2 instance with capistrano.</p></div>
<div class="shr-publisher-155"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://blog.bhushangahire.net/2010/02/17/setup-capistrano-to-deploy-rails-application-on-amazon-ec2-with-git/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Step-By-Step setup slicehost server (fedora) for rails application.</title>
		<link>http://blog.bhushangahire.net/2009/07/22/step-by-step-setup-slicehost-server-fedora-for-rails-application/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=step-by-step-setup-slicehost-server-fedora-for-rails-application</link>
		<comments>http://blog.bhushangahire.net/2009/07/22/step-by-step-setup-slicehost-server-fedora-for-rails-application/#comments</comments>
		<pubDate>Wed, 22 Jul 2009 10:11:00 +0000</pubDate>
		<dc:creator>Bhushan Ahire</dc:creator>
				<category><![CDATA[capistrano]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Subversion]]></category>
		<category><![CDATA[mongrel]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[setup]]></category>

		<guid isPermaLink="false">http://blog.bhushangahire.net/?p=136</guid>
		<description><![CDATA[Hi all as I worked on setting up 4 to 5 servers, I thought its better to document the stuff so that I/developers can refer it, So I am documenting the step-by-step process for setting up the slicehost server for rails application work with nginx as a web server and mongrel as a rails application [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><div id="content"><!--single.php--></p>
<p><!--loop--></p>
<p><!--post title--></p>
<div class="post-meta-top">
<div class="clearboth"></div>
<p><!--content with more link--></p>
<div>Hi all as I worked on setting up 4 to 5 servers, I thought its better to document the stuff so that I/developers can refer it, So I am documenting the step-by-step process for setting up the slicehost server for rails application work with <strong>nginx</strong> as a web server and <strong>mongrel</strong> as a rails application server.</div>
<div>
<h2>Update</h2>
<div class="level2">
<p>To update your system:</p>
<blockquote><p>yum update</p></blockquote>
</div>
<h2>MySQL</h2>
<div class="level2">
<p>to install mysql client and server apps</p>
<blockquote><p>yum install mysql-server</p></blockquote>
<p>The client package “mysql” will automatically be installed as a dependency.</p></div>
<h2>Apache</h2>
<div class="level2">
<blockquote><p>yum install httpd</p></blockquote>
</div>
<h2>PHP5</h2>
<div class="level2">
<p>To install php with soap, xml and mysql plugins:</p>
<blockquote><p>yum install php php-soap php-xml php-mysql</p></blockquote>
<p>some other php plugin utilities that are common:</p>
<blockquote><p>yum install php-mbstring php-gd</p></blockquote>
</div>
<h2>Ruby</h2>
<div class="level2">
<blockquote><p>yum install ruby</p></blockquote>
</div>
<h2>Utilities</h2>
<div class="level2">
<p>other useful utilities:</p>
<blockquote><p>yum install nano wget elinks subversion vi</p></blockquote>
</div>
</div>
<div>
<h2>Nginx</h2>
<div class="level2">
<p>install nginx web server:</p>
<blockquote><p>yum install nginx</p></blockquote>
</div>
<h2>Mongrel Cluster</h2>
<div class="level2">
<p>install mongrel_cluster:</p>
<blockquote><p>gem install mongrel_cluster –include-dependencies</p></blockquote>
</div>
<p>Setup your nginx configuration for your rails application and mongrel_cluster (proxy).</p>
<p>Below you found sample config file for nginx.conf (normally located in “/etc/nginx/conf/nginx.conf”)</p>
<blockquote>
<pre>user  deploy;
worker_processes  1;
error_log   logs/error.log debug;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;
#pid        logs/nginx.pid;
events {
    worker_connections  1024;
}
http {
  include        conf/mime.types;
  default_type   application/octet-stream;
  sendfile        on;
  #tcp_nopush     on;
  keepalive_timeout  65;
  tcp_nodelay        on;
  gzip  on;
  gzip_min_length  1100;
  gzip_buffers     4 8k;
  gzip_types       text/plain;
  upstream mongrel {
    server 127.0.0.1:8000;
    server 127.0.0.1:8001;
  }
  server {
    listen       80;
    server_name  example.com;
    root /var/www/apps/example/current/public;
    index  index.html index.htm;
    location / {
      proxy_set_header  X-Real-IP  $remote_addr;
      proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header Host $http_host;
      proxy_redirect false;
      if (-f $request_filename/index.html) {
        rewrite (.*) $1/index.html break;
      }
      if (-f $request_filename.html) {
        rewrite (.*) $1.html break;
      }
      if (!-f $request_filename) {
        proxy_pass http://mongrel;
        break;
      }
    }
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   html;
    }
  }
}</pre>
</blockquote>
</div>
<p>Restart the nginx server:</p>
<blockquote><p>/etc/init.d/nginx restart</p></blockquote>
<div>
<h2>Mongrel Configuration:</h2>
<p>Now Go to the application directory and create a configuration for Mongrel:</p>
<blockquote><p>mongrel_rails cluster::configure -e production -p 8000 -a 127.0.0.1 -N 2 -c /home/APP/production/APP/current</p></blockquote>
<p>it will create the config/mongrel_cluster.yml file; basically you do not need to edit it.</p>
<p>You can test cluster with</p>
<p>To Start:</p>
<blockquote><p>mongrel_rails cluster::start</p></blockquote>
<p>To Stop:</p>
<blockquote><p>mongrel_rails cluster::stop</p></blockquote>
<p>To Restart:</p>
<blockquote><p>mongrel_rails cluster::restart</p></blockquote>
</div>
<div>
<h2>Capistrano Configuration:</h2>
<p>Then create a configuration for Capistrano:</p>
<blockquote><p>cap –apply-to .</p></blockquote>
<p>we need to modify the generated file config/deploy.rb:</p>
<blockquote>
<pre>require 'mongrel_cluster/recipes'

#you set the APP name with the cap command
set :application, "APP"
#a path to your repository
set :repository, "svn+ssh://USERNAME@SVN_SERVER/projects/#{application}/trunk"

role :web, "SERVER"
role :app, "SERVER"
role :db, "SERVER", :primary =&gt; true

#where to deploy (copy the files) on the server; I created a special user APP for the</pre>
<pre>application (if you do not like it, replace the /home/#{application} part with your path
set :deploy_to, "/home/#{application}/production/#{application}"
set :mongrel_conf, "#{current_path}/config/mongrel_cluster.yml"
#if the server login name is different to the development computer login name; in my case</pre>
<pre>the user name is the APP nameset :user, "APP"</pre>
</blockquote>
<p>Make necessary changes to the config/database.yml file.</p></div>
<div>
<h2>Capistrano Deployment:</h2>
<p>Create the basic structure on the server:</p>
<blockquote><p>cap deploy:setup</p></blockquote>
<p>For the first deployment you can use cold deploy:</p>
<blockquote><p>cap cold_deploy</p></blockquote>
<p>After that for next deployments you have to use:</p>
<blockquote><p>cap deploy</p></blockquote>
<p>You can also run migration from capistrano with:</p>
<blockquote><p>cap deploy:migrate<sup>*</sup></p></blockquote>
<p><sup>*</sup> Note: It wont work for me, it migrating to the previous release available in the releses folder, So I suggest you manually run migration on server.</div>
<div>
<p>That’s it, your server is ready to run.</p>
<p>Hope this documentation will be helpful to you, Enjoy <img src='http://blog.bhushangahire.net/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> .</div>
<p><!--for paginate posts--></p>
<p><!--Post Meta--></div>
</div>
<div class="shr-publisher-136"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://blog.bhushangahire.net/2009/07/22/step-by-step-setup-slicehost-server-fedora-for-rails-application/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Synchronize old svn with all revision history to new repository</title>
		<link>http://blog.bhushangahire.net/2008/03/04/synchronize-old-svn-with-all-revision-history-to-new-repository/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=synchronize-old-svn-with-all-revision-history-to-new-repository</link>
		<comments>http://blog.bhushangahire.net/2008/03/04/synchronize-old-svn-with-all-revision-history-to-new-repository/#comments</comments>
		<pubDate>Tue, 04 Mar 2008 11:28:23 +0000</pubDate>
		<dc:creator>Bhushan Ahire</dc:creator>
				<category><![CDATA[Subversion]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://www.bhushangahire.net/2008/03/04/synchronize-old-svn-with-all-revision-history-to-new-repository/</guid>
		<description><![CDATA[First, create a SVN user for svnsync to use &#8211; let’s call this the ’svnsync user’. The easiest (and best) way to do this is edit the svnserve.conf and passwd files: conf/svnserve.conf # Uncomment this line. password-db = passwd conf/passwd svnsync = secret This gives read and write access to the ’svnsync user’. The svnsync [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p class="content">First, create a SVN user for svnsync to use &#8211; let’s call this the ’svnsync user’. The easiest (and best) way to do this is edit the svnserve.conf and passwd files:</p>
<p><strong>conf/svnserve.conf</strong></p>
<pre><code>
# Uncomment this line.
password-db = passwd
</code></pre>
<p><strong>conf/passwd</strong></p>
<pre><code>
svnsync = secret
</code></pre>
<p>This gives read and write access to the ’svnsync user’. The <code>svnsync</code> program will authenticate with our repositories as this user via the <code>svn://</code> protocol (i.e. via svnserve).</p>
<p>Next, we need to create a <code>pre-revprop-change</code> hook for the destination repository. The <a href="http://svn.collab.net/repos/svn/trunk/notes/svnsync.txt">svnsync documentation</a> has a detailed explanation. Create a <code>hooks/pre-revprop-change</code> file under your destination repository’s directory.</p>
<pre><code>
#!/bin/sh
USER="$3"

if [ "$USER" = "svnsync" ]; then exit 0; fi

echo "Only the svnsync user can change revprops" &gt;&amp;2
exit 1</code></pre>
<p>Make it executable, and then initialize the sync:</p>
<pre><code>
chmod +x hooks/pre-revprop-change
svnsync init file:///var/svn/repositories/destination_repos svn://source.host/source_repos</code></pre>
<p>Don’t worry, this only sets up the sync &#8211; there’s no actual data copying yet. Syncing your repository data may take a long time if you have a big source repository, so I suggest using <code>nohup</code> to run the code overnight (or something), or at least saving the output in a log. Either way, the command to start the sync is:</p>
<pre><code>svnsync sync --username svnsync file:///var/svn/repositories/testsync/</code></pre>
<p>You should start seeing svnsync committing in changes from your source repository. Instant gratification (well, almost)! Should your svnsync process get aborted or killed, you can remove the hanging lock by running:</p>
<pre><code>svn propdel svn:sync-lock --revprop -r 0</code></pre>
<h3>Setting up ‘on-the-fly’ syncing</h3>
<p>So now you have your source and destination repositories synced, but what happens when you start committing changes to your source repository? Nothing! That’s because svnsync is merely a passive syncing tool (meaning you have to run it to sync, instead of it knowing when to sync automatically).</p>
<p>There are two ways you can setup ‘real-time’ syncing:</p>
<ol>
<li>     Use <code>cron</code> (or a similar scheduler) on the destination repository server. Add something like this to your <code>crontab</code>:
<pre><code>* * * * * /usr/local/bin/svnsync --non-interactive sync svn://source.host/source_repos</code></pre>
<p>This basically runs svnsync on your destination repository server every minute to pull down any changes to your source repository.</li>
<li>Add a post-commit hook to the source repository. I found this <a href="http://journal.paul.querna.org/articles/2006/09/14/using-svnsync">svnsync entry by Paul Querna</a> that has a sample post-commit hook. If I recall correctly I tried it but it didn’t work for me, so I settled on using cron to sync up my repositories.</li>
</ol>
<div class="shr-publisher-35"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://blog.bhushangahire.net/2008/03/04/synchronize-old-svn-with-all-revision-history-to-new-repository/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

