<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>Making Your Own Subversion Backups</title>
    <link>http://xp-dev.com/blog/551/making-your-own-subversion-backups</link>
    <description />
    <pubDate>Mon, 08 Jun 2009 02:37:42 GMT</pubDate>
    <dc:creator>rs</dc:creator>
    <dc:date>2009-06-08T02:37:42Z</dc:date>
    <item>
      <title>Making Your Own Subversion Backups</title>
      <link>http://xp-dev.com/blog/551/making-your-own-subversion-backups</link>
      <description>&lt;p&gt;Since the &lt;a href="http://www.xp-dev.com/blogs/view/451/infrastructure-and-account-upgrades/"&gt;recent changes in accounts&lt;/a&gt;, subversion repositories for Free accounts are no longer backed up.&lt;/p&gt;&lt;p&gt;Now, before you Free users out there start getting nervous and/or panicking, there is a quick backup solution following the &lt;a href="http://en.wikipedia.org/wiki/Do_it_yourself"&gt;D.I.Y.&lt;/a&gt; principle.&lt;/p&gt;&lt;h3 id="Syncemup"&gt;Sync 'em up&lt;/h3&gt;&lt;p&gt;Subversion provide some really good tools in its arsenal for free. One of them is called &lt;a href="http://svn.collab.net/repos/svn/trunk/notes/svnsync.txt"&gt;svnsync&lt;/a&gt; which aids in taking away all the headache of keeping a full copy of a repository (including its changes and revision history!). The best part of &lt;em&gt;svnsync&lt;/em&gt; is in its ease of use (albeit with some initial setup learning curve):&lt;/p&gt;&lt;h4 id="Createalocalrepository"&gt;Create a local repository&lt;/h4&gt;&lt;p&gt;First, we need to create a local repository that will be our copy of the subversion repository on XP-Dev.com:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;svnadmin create xpdevcopy
&lt;/code&gt;&lt;/pre&gt;&lt;h4 id="Addaprerevpropchangehook"&gt;Add a pre-revprop-change hook&lt;/h4&gt;&lt;p&gt;Next (this is mandatory) you will need to add a &lt;em&gt;pre revision property change&lt;/em&gt; hook, which will allow &lt;em&gt;svnsync&lt;/em&gt; to put in some of its own variables to do its magic.&lt;/p&gt;&lt;p&gt;Unix users can perform the following:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;cat &amp;lt;&amp;lt;'EOF' &amp;gt; xpdevcopy/hooks/pre-revprop-change
#!/bin/sh
exit 0
EOF
#Dont forget to set the execution flag
chmod +x xpdevcopy/hooks/pre-revprop-change

&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Windows users, an empty hook script (basically an empty file) should be installed in &lt;code&gt;xpdevcopy\hooks\pre-revprop-change.bat&lt;/code&gt;&lt;/p&gt;&lt;h4 id="Initialisethecopy"&gt;Initialise the copy&lt;/h4&gt;&lt;p&gt;You&amp;#8217;ll need to initialise the copy repository, and this only has to be done once. Svnsync adds some of its own variables in the copy repository in this step.&lt;/p&gt;&lt;p&gt;&lt;em&gt;Do remember to replace &lt;code&gt;http://svn.xp-dev.com/svn/myrepository&lt;/code&gt; with the location of your XP-Dev.com repository in the following commands&lt;/em&gt;&lt;/p&gt;&lt;p&gt;Unix users:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;svnsync init file://`pwd`/xpdevcopy http://svn.xp-dev.com/svn/myrepository
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Windows users &lt;em&gt;(do remember to replace &lt;code&gt;c:/path/to/xpdevcopy&lt;/code&gt; with the full path of your repository)&lt;/em&gt;:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;svnsync init file:///c:/path/to/xpdevcopy http://svn.xp-dev.com/svn/myrepository
&lt;/code&gt;&lt;/pre&gt;&lt;h4 id="Startsyncing"&gt;Start syncing&lt;/h4&gt;&lt;p&gt;Syncing is when &lt;em&gt;svnsync&lt;/em&gt; starts downloading all the various revisions and stores them in your copy:&lt;/p&gt;&lt;p&gt;For Unix systems:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;svnsync sync file://`pwd`/xpdevcopy
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Or Windows:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;svnsync sync file:///c:/path/to/xpdevcopy
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;And that&amp;#8217;s it. The next time you want to re-sync your local copy of the repository, all you need to do is execute the last step above, i.e. &lt;code&gt;svnsync sync file://path/to/xpdevcopy&lt;/code&gt;&lt;/p&gt;&lt;h3 id="IntegrationwithXPDev.comWebhooks"&gt;Integration with XP-Dev.com Webhooks&lt;/h3&gt;&lt;p&gt;Now, if you&amp;#8217;re really into your scripts and would love to have a real-time backup for your repository, all you have to do is install a &lt;a href="http://www.xp-dev.com/wiki/1/Post-Commit-Webhooks"&gt;Post Commit Webhook&lt;/a&gt; on your XP-Dev.com subversion repository and get your receiver web script to perform the &lt;code&gt;svnsync sync file://path/to/xpdevcopy&lt;/code&gt; process above.&lt;/p&gt;&lt;p&gt;Of course, you could just &lt;a href="http://www.xp-dev.com/wiki/1/Upgrading-To-XP-Dev-Pro"&gt;upgrade to a Pro account&lt;/a&gt; and get the real-time backups out of the box.&lt;/p&gt;</description>
      <pubDate>Mon, 08 Jun 2009 02:37:42 GMT</pubDate>
      <guid>http://xp-dev.com/blog/551/making-your-own-subversion-backups</guid>
      <dc:creator>rs</dc:creator>
      <dc:date>2009-06-08T02:37:42Z</dc:date>
    </item>
    <item>
      <title>Comment #15230</title>
      <link>http://xp-dev.com/blog/551/making-your-own-subversion-backups</link>
      <description>&lt;p&gt;Here there a way to create this as a cron task to run once a day/week?&lt;/p&gt;&lt;p&gt;Also do you just create different svnadmin folders to the differnet subversions you have permission to?&lt;/p&gt;</description>
      <pubDate>Fri, 29 May 2009 17:27:06 GMT</pubDate>
      <guid>http://xp-dev.com/blog/551/making-your-own-subversion-backups</guid>
      <dc:creator>bbgpsgolf</dc:creator>
      <dc:date>2009-05-29T17:27:06Z</dc:date>
    </item>
    <item>
      <title>Comment #15272</title>
      <link>http://xp-dev.com/blog/551/making-your-own-subversion-backups</link>
      <description>&lt;p&gt;@bbgpsgolf using it with cron is pretty easy and doable. There&amp;#8217;s a &lt;a href="http://www.unixgeeks.org/security/newbie/unix/cron-1.html"&gt;simple introduction article&lt;/a&gt; that can help you out.&lt;/p&gt;&lt;p&gt;If I&amp;#8217;m not mistaken you should create one folder for each repository. I haven&amp;#8217;t tried &amp;#8220;joining&amp;#8221; repositories into one. While theoretically it might be possible, having them distinct is usually good practice.&lt;/p&gt;</description>
      <pubDate>Sat, 30 May 2009 03:05:58 GMT</pubDate>
      <guid>http://xp-dev.com/blog/551/making-your-own-subversion-backups</guid>
      <dc:creator>rs</dc:creator>
      <dc:date>2009-05-30T03:05:58Z</dc:date>
    </item>
    <item>
      <title>Comment #15470</title>
      <link>http://xp-dev.com/blog/551/making-your-own-subversion-backups</link>
      <description>&lt;p&gt;I&amp;#8217;m trying to get this setup, but I&amp;#8217;m running into a problem with the initialization. I&amp;#8217;m on Windows XP, run VisualSVN Server(&lt;a href="http://www.visualsvn.com/server/)"&gt;http://www.visualsvn.com/server/)&lt;/a&gt; locally, which consist of(from the readme file):&lt;/p&gt;&lt;p&gt;- Subversion 1.6.2&lt;br/&gt;- Apache 2.2.9&lt;br/&gt;- OpenSSL 0.9.8k&lt;br/&gt;- ZLib 1.2.3&lt;br/&gt;- Neon 0.28.4&lt;/p&gt;&lt;p&gt;The line I&amp;#8217;m running is:&lt;br/&gt;svnsync init file://c:/Repositories/xpdevcopy &lt;a href="http://svn2.xp-dev.com/svn/bonelifer-forum/"&gt;http://svn2.xp-dev.com/svn/bonelifer-forum/&lt;/a&gt;&lt;/p&gt;&lt;p&gt;I get this error:&lt;br/&gt;svnsync: Unable to open an ra_local session to URL&lt;br/&gt;svnsync: Unable to open repository 'file://c:/Repositories/xpdevcopy'&lt;/p&gt;&lt;p&gt;The repository link is correct as it opens in Windows to the right folder&lt;/p&gt;&lt;p&gt;I&amp;#8217;m not sure what&amp;#8217;s going on.&lt;/p&gt;</description>
      <pubDate>Mon, 01 Jun 2009 21:14:09 GMT</pubDate>
      <guid>http://xp-dev.com/blog/551/making-your-own-subversion-backups</guid>
      <dc:creator>bonelifer</dc:creator>
      <dc:date>2009-06-01T21:14:09Z</dc:date>
    </item>
    <item>
      <title>Comment #15482</title>
      <link>http://xp-dev.com/blog/551/making-your-own-subversion-backups</link>
      <description>&lt;p&gt;Okay I think I may have figured out what I needed to change.&lt;/p&gt;&lt;p&gt;Here&amp;#8217;s my initilization line:&lt;/p&gt;&lt;p&gt;svnsync init &lt;a href="https://jeanna:8443/svn/xpdevcopy/"&gt;https://jeanna:8443/svn/xpdevcopy/&lt;/a&gt; &lt;a href="http://svn2.xp-dev.com/svn/bonelifer-forum/"&gt;http://svn2.xp-dev.com/svn/bonelifer-forum/&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Here&amp;#8217;s the sync line:&lt;br/&gt;svnsync sync &lt;a href="https://jeanna:8443/svn/xpdevcopy/"&gt;https://jeanna:8443/svn/xpdevcopy/&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Just have to remember to use the HTTPS url that VisualSVN Server uses.&lt;/p&gt;&lt;p&gt;I wonder if you could confirm this is right just to make sure.&lt;/p&gt;</description>
      <pubDate>Mon, 01 Jun 2009 22:15:49 GMT</pubDate>
      <guid>http://xp-dev.com/blog/551/making-your-own-subversion-backups</guid>
      <dc:creator>bonelifer</dc:creator>
      <dc:date>2009-06-01T22:15:49Z</dc:date>
    </item>
    <item>
      <title>Comment #15483</title>
      <link>http://xp-dev.com/blog/551/making-your-own-subversion-backups</link>
      <description>&lt;p&gt;Never mind I re-read the entire post and found what I missed. I assume though that I should set my local copy read-only.&lt;/p&gt;&lt;p&gt;OK, I&amp;#8217;ve figured it out for myself. Obviously it has to able to be written too. I wasn&amp;#8217;t thinking very well when I asked that. For those using using VisualSVN server(locally), also note that when you first initialize that it will tell you that the servers SSL cert is self-signed, just tell it to permanently remember this cert is good.  &lt;/p&gt;</description>
      <pubDate>Mon, 01 Jun 2009 23:31:04 GMT</pubDate>
      <guid>http://xp-dev.com/blog/551/making-your-own-subversion-backups</guid>
      <dc:creator>bonelifer</dc:creator>
      <dc:date>2009-06-01T23:31:04Z</dc:date>
    </item>
    <item>
      <title>Comment #16023</title>
      <link>http://xp-dev.com/blog/551/making-your-own-subversion-backups</link>
      <description>&lt;p&gt;Using SubVersion 1.5.6 on XP, I needed an extra slash in the file arguments, thus&lt;/p&gt;&lt;p&gt;file:///&lt;/p&gt;</description>
      <pubDate>Sun, 07 Jun 2009 09:18:34 GMT</pubDate>
      <guid>http://xp-dev.com/blog/551/making-your-own-subversion-backups</guid>
      <dc:creator>sjwood140263</dc:creator>
      <dc:date>2009-06-07T09:18:34Z</dc:date>
    </item>
    <item>
      <title>Comment #16072</title>
      <link>http://xp-dev.com/blog/551/making-your-own-subversion-backups</link>
      <description>&lt;p&gt;Thanks sjwood140263. I&amp;#8217;ved fixed the windows paths&lt;/p&gt;</description>
      <pubDate>Mon, 08 Jun 2009 02:38:05 GMT</pubDate>
      <guid>http://xp-dev.com/blog/551/making-your-own-subversion-backups</guid>
      <dc:creator>rs</dc:creator>
      <dc:date>2009-06-08T02:38:05Z</dc:date>
    </item>
  </channel>
</rss>


