<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Peter's Blog - Nodes for subversion</title>
    <link>http://www.petersblog.org/</link>
    <description>Nodes containing the tag subversion</description>
    <item>
      <title>vsftpd</title>
      <link>http://www.petersblog.org/node/view/1579</link>
      <description>&lt;p&gt;
I had a need to put an ftp server on my &lt;a href="/tag/slicehost"&gt;slicehost&lt;/a&gt; slice so someone could upload stuff to a site I was hosting. I'd rather avoid ftp as a potential security hole but the alternative is to try to convert them to sftp and also the &lt;a href="/node/1576"&gt;E editor&lt;/a&gt; only supports ftp. 
&lt;/p&gt;
&lt;p&gt;
I settled for vsftpd as the ftp server but it took ages to get this person's login to work. I had him set up chrooted to the directory he needed to be in and with his shell set to /bin/false to prevent him logging into a shell. When testing I couldn't log in as him without getting a generic error 530, login denied according to the log file (which didn't feel the need to say &lt;i&gt;why&lt;/i&gt; login was denied). Of course my own login was fine. 
&lt;/p&gt;
&lt;p&gt;
The answer was in the vsftpd faq, it seems that vsftpd looks through a file called /etc/shells to see if the person connecting has a legitimate login shell and /bin/false wasn't in there. It says this check can be disabled but the incantation didn't work so I had to add /bin/false to the shells file. 
&lt;/p&gt;
&lt;p&gt;
I don't quite understand the logic of this design. Isn't it fairly standard to have users who can ftp in but not login? The /bin/false trick was following a precedent from the noble ubuntu/debian distributions. 
&lt;/p&gt;
&lt;p&gt;
I'm getting into the habit now of adding any file I edit in /etc to subversion (as noted &lt;a href="/node/1559"&gt;here&lt;/a&gt;), if only as a way to keep track of which ones I have fiddled with. The 95% that I don't need to touch are not in subversion. I like this, I can recall what I did and why (through subversion comments) which will help me restore the system or replicate it. That way, next time I need to install vsftpd I can recall what other obscure system files need tweeking. 
&lt;/p&gt;&lt;p&gt;Related Posts: &lt;a href="/tag/ftp"&gt;ftp&lt;/a&gt; &lt;a href="/tag/linux"&gt;linux&lt;/a&gt; &lt;a href="/tag/subversion"&gt;subversion&lt;/a&gt; &lt;a href="/tag/vsftpd"&gt;vsftpd&lt;/a&gt;&lt;/p&gt;</description>
      <guid>http://www.petersblog.org/node/view/1579</guid>
      <category domain="http://www.technorati.com/tag">ftp</category>
      <category domain="http://www.technorati.com/tag">linux</category>
      <category domain="http://www.technorati.com/tag">subversion</category>
      <category domain="http://www.technorati.com/tag">vsftpd</category>
    </item>
    <item>
      <title>Faster Blogging</title>
      <link>http://www.petersblog.org/node/view/1559</link>
      <description>&lt;p&gt;
I'm so taken with my new &lt;a href="/node/1554"&gt;SliceHost VPS&lt;/a&gt; that I've moved this blog over to it. For the first time in four years this blog is hosted on something other than Apache: &lt;a href="/node/1557"&gt;Nginx&lt;/a&gt;. It's still on &lt;a href="/tag/drupal"&gt;drupal&lt;/a&gt; but running under php5 for the first time (only needing &lt;a href="http://drupal.org/node/93456"&gt;this fix&lt;/a&gt;). 
&lt;/p&gt;
&lt;p&gt;
The DNS has only just propogated so this is my first posting on the new host. To me it feels snappier when navigating around, a definite improvement. 
&lt;/p&gt;
&lt;p&gt;
I've been moving all my sites over to the new host, I've decided to put all my eggs in one basket. Well, not quite, I've also signed up for a minimal &lt;a href="http://rsync.net/"&gt;rsync.net&lt;/a&gt; account, giving me just over 3g of backup space. It will cost me circa &#163;2.50 a month but will be worth it for the peace of mind. 
&lt;/p&gt;
&lt;p&gt;
I've put all my sites and also my most important /etc directories (such as /etc/nginx) into a subversion repository. I found a great subversion tip for checking /etc into subversion in the &lt;a href="http://subversion.tigris.org/faq.html"&gt;subversion faq&lt;/a&gt;: 
&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;
How can I do an in-place 'import' (i.e. add a tree to Subversion such that the original data becomes a working copy directly)? 
&lt;/p&gt;
&lt;p&gt;
Suppose, for example, that you wanted to put some of /etc under version control inside your repository: 
&lt;/p&gt;
&lt;ol&gt;&lt;li&gt;
svn mkdir file:///root/svn-repository/etc \          -m "Make a directory in the repository to correspond to /etc" 
&lt;/li&gt;
&lt;li&gt;
cd /etc 
&lt;/li&gt;
&lt;li&gt;
svn checkout file:///root/svn-repository/etc . 
&lt;/li&gt;
&lt;li&gt;
svn add apache samba alsa X11 
&lt;/li&gt;
&lt;li&gt;
svn commit -m "Initial version of my config files" 
&lt;/li&gt;&lt;/ol&gt;

&lt;p&gt;
This takes advantage of a not-immediately-obvious feature of svn checkout: you can check out a directory from the repository directly into an existing directory. Here, we first make a new empty directory in the repository, and then check it out into /etc, transforming /etc into a working copy. Once that is done, you can use normal svn add commands to select files and subtrees to add to the repository. 
&lt;/p&gt;
&lt;p&gt;
There is an issue filed for enhancing svn import to be able to convert the imported tree to a working copy automatically; see issue 1328. 
&lt;/p&gt;
&lt;p&gt;
&lt;/blockquote&gt; 
&lt;/p&gt;
&lt;p&gt;
So all the juicy stuff is in subversion and then I rsync the subversion repository over to rsync.net for the backup (nb, don't rsync a live svn repository while anyone else is modifying it!). This will allow me to roll-back changes should need be (or more likely see what I've changed to break something) using the Slicehost subversion repositories. 
&lt;/p&gt;
&lt;p&gt;
If anything does go wrong with my Slicehost slice (not saying it will but it might), I can rent a new VPS or dedicated server and have my stuff back up and running in less than a day (DNS propgation to the new server would be the delaying factor). It's not perfect redundancy but I'm not shafted. 
&lt;/p&gt;
&lt;p&gt;
Probably a more likely scerario is my server gets pwned in which case I would remaster it. 
&lt;/p&gt;
&lt;p&gt;
The rsync copy between the Slicehost and rsync runs at 583850.15 bytes/sec. Pretty good. 
&lt;/p&gt;
&lt;p&gt;
Possible improvements: 
&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;
Use &lt;a href="http://duplicity.nongnu.org/"&gt;Duplicity&lt;/a&gt; to backup the repositories, with a full+incremental scheme. 
&lt;/li&gt;
&lt;li&gt;
Put a web front end on the subversion repositories so I can browse them (although [subclipse|http://subclipse.tigris.org/) is working nicely). 
&lt;/li&gt;&lt;/ul&gt;

&lt;p&gt;
UPDATE: I've noticed this article getting hits for people looking how to copy a subversion repository. The simple answer is to just copy the files: cp -rf, rsync -a, however you like copying things. If the repository is live (i.e people are using it) or it will be running on a different version of subversion then the answer is to use: 
&lt;/p&gt;
&lt;pre class="lazy"&gt;svnadmin dump path-to-repository &lt;span class="Keyword"&gt;&amp;gt;&lt;/span&gt; dump.dat
cp dump.dat {wherever}
cd {wherever}
svnadmin load path-to-new-repository &lt;span class="Keyword"&gt;&amp;lt;&lt;/span&gt; dump.dat
&lt;/pre&gt;&lt;p&gt;Related Posts: &lt;a href="/tag/rsync"&gt;rsync&lt;/a&gt; &lt;a href="/tag/slicehost"&gt;slicehost&lt;/a&gt; &lt;a href="/tag/subversion"&gt;subversion&lt;/a&gt; &lt;a href="/tag/svn"&gt;svn&lt;/a&gt;&lt;/p&gt;</description>
      <guid>http://www.petersblog.org/node/view/1559</guid>
      <category domain="http://www.technorati.com/tag">rsync</category>
      <category domain="http://www.technorati.com/tag">slicehost</category>
      <category domain="http://www.technorati.com/tag">subversion</category>
      <category domain="http://www.technorati.com/tag">svn</category>
    </item>
    <item>
      <title>Trac</title>
      <link>http://www.petersblog.org/node/view/1073</link>
      <description>&lt;p&gt;
I have noticed more and more projects using &lt;a href="http://www.edgewall.com/trac/"&gt;trac&lt;/a&gt; so I decided to install it and give it a try. It is really nice. It does the following: 
&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;
provides a web interface to &lt;a href="/tag/subversion"&gt;subversion&lt;/a&gt; source repositories. The web interface allows you to look at different revisions of files, do diffs between revisions, all good stuff. You cannot commit changes, update or do anything with local working copies of files but these are just a batch file away. 
&lt;/li&gt;
&lt;li&gt;
it provides a wiki so you can document your project however you like. The wiki markup supports links to files in subversion, change sets and the like so you have no excuses for not describing the grand picture anywhere. 
&lt;/li&gt;
&lt;li&gt;
it provides a bug tracking database which is like &lt;a href="/tag/bugzilla"&gt;bugzilla&lt;/a&gt; but cleaner and simpler. 
&lt;/li&gt;&lt;/ul&gt;

&lt;p&gt;
It was easy to set up as a &lt;a href="/tag/debian"&gt;debian&lt;/a&gt; package, just a matter of installing the trac package and running the trac-admin command to create a new trac project. Tell that where your subversion repository is and you are away. 
&lt;/p&gt;
&lt;p&gt;
The more I use subversion, the more I like it. Not having to check files out is really nice and cuts down on the hastle: just edit any file. 
&lt;/p&gt;
&lt;p&gt;
Commercial development requires more formal documentation than a wiki but I do feel there could be a role for informal documentation attached to the source code: useful documentation, not the stuff that is only there to keep the QA department happy. 
&lt;/p&gt;
&lt;p&gt;
Oh, did I mention trac was written in &lt;a href="/tag/python"&gt;python&lt;/a&gt;? 
&lt;/p&gt;
&lt;p&gt;
If I could integrate an email archive and a development blog into trac, I would have the fount of all knowledge. 
&lt;/p&gt;&lt;p&gt;Related Posts: &lt;a href="/tag/python"&gt;python&lt;/a&gt; &lt;a href="/tag/subversion"&gt;subversion&lt;/a&gt; &lt;a href="/tag/trac"&gt;trac&lt;/a&gt;&lt;/p&gt;</description>
      <guid>http://www.petersblog.org/node/view/1073</guid>
      <category domain="http://www.technorati.com/tag">python</category>
      <category domain="http://www.technorati.com/tag">subversion</category>
      <category domain="http://www.technorati.com/tag">trac</category>
    </item>
    <item>
      <title>Redirecting directories in Apache</title>
      <link>http://www.petersblog.org/node/view/984</link>
      <description>&lt;p&gt;
I've discovered the 'Alias' keyword in &lt;a href="/tag/apache"&gt;apache&lt;/a&gt;2 config files. This keyword allows a pretty free hand at redirecting urls to directories and files on the hard disk. Consider this extract from the site config file (in /etc/apache2/sites-available/intranet): 
&lt;/p&gt;
&lt;div class="verbatim-block"&gt;&lt;pre&gt;&amp;lt;VirtualHost *&amp;gt;
    ServerName intranet
    ServerAdmin webmaster@localhost

    DocumentRoot /var/www/intranet
    &amp;lt;Directory /&amp;gt;
        Options FollowSymLinks
        AllowOverride All
    &amp;lt;/Directory&amp;gt;
    &amp;lt;Directory /var/www/intranet&amp;gt;
        # pcw No directory listsings
        # Options Indexes FollowSymLinks MultiViews
        Options -Indexes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        allow from all
    &amp;lt;/Directory&amp;gt;

    Alias /bugzilla &amp;quot;/var/www/bugzilla/&amp;quot;
    &amp;lt;Directory &amp;quot;/var/www/bugzilla/&amp;quot;&amp;gt;
        Options ExecCGI -Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from all
    &amp;lt;/Directory&amp;gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;
This is telling apache that the site is called 'intranet' and is normally served up from the directory /var/www/intranet. However, there is a subdirectory called 'bugzilla' that is addressed as http://intranet/bugzilla but is served up from /var/www/bugzilla rather than /var/www/intranet/bugzilla. 
&lt;/p&gt;
&lt;p&gt;
Why would I want to do this? Because /var/www/intranet is a &lt;a href="/tag/drupal"&gt;drupal&lt;/a&gt; setup stored in &lt;a href="/tag/subversion"&gt;subversion&lt;/a&gt; and I don't want to put the &lt;a href="/tag/bugzilla"&gt;bugzilla&lt;/a&gt; stuff in subversion or fiddle around telling subversion to ignore it. It keeps each feature of the domain cleanly seperated. 
&lt;/p&gt;&lt;p&gt;Related Posts: &lt;a href="/tag/apache"&gt;apache&lt;/a&gt; &lt;a href="/tag/bugzilla"&gt;bugzilla&lt;/a&gt; &lt;a href="/tag/subversion"&gt;subversion&lt;/a&gt;&lt;/p&gt;</description>
      <guid>http://www.petersblog.org/node/view/984</guid>
      <category domain="http://www.technorati.com/tag">apache</category>
      <category domain="http://www.technorati.com/tag">bugzilla</category>
      <category domain="http://www.technorati.com/tag">subversion</category>
    </item>
    <item>
      <title>Subversion locale problem on ubuntu</title>
      <link>http://www.petersblog.org/node/view/975</link>
      <description>&lt;p&gt;
Trying to run &lt;a href="/tag/subversion"&gt;subversion&lt;/a&gt; on &lt;a href="/tag/ubuntu"&gt;ubuntu&lt;/a&gt;, I kept getting the error: 
&lt;/p&gt;
&lt;div class="verbatim-block"&gt;&lt;pre&gt;svn: error: cannot set LC_ALL locale
svn: error: environment variable LANG is en_GB.UTF-8
svn: error: please check that your locale name is correct
svn: Connection closed unexpectedly
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;
Googling seems to imply that this one is a bit of a mystery, svn doesn't like the LANG variable and is happier if it is not set. I found that LANG was being set in /etc/environment on my ubuntu box and that this file didn't exist on my &lt;a href="/tag/debian"&gt;debian&lt;/a&gt; server where LANG was not defined. 
&lt;/p&gt;
&lt;p&gt;
I commented it out and reconnected and joy ensued. 
&lt;/p&gt;
&lt;p&gt;
Running 
&lt;/p&gt;
&lt;pre class="lazy"&gt;sudo dpkg-reconfigure locales
&lt;/pre&gt;
&lt;p&gt;
does not break it again. 
&lt;/p&gt;
&lt;p&gt;
I did a google for LANG and found k.d.lang's website. 
&lt;/p&gt;
&lt;p&gt;
Moral: hack it out and see what breaks. 
&lt;/p&gt;&lt;p&gt;Related Posts: &lt;a href="/tag/debian"&gt;debian&lt;/a&gt; &lt;a href="/tag/subversion"&gt;subversion&lt;/a&gt; &lt;a href="/tag/ubuntu"&gt;ubuntu&lt;/a&gt;&lt;/p&gt;</description>
      <guid>http://www.petersblog.org/node/view/975</guid>
      <category domain="http://www.technorati.com/tag">debian</category>
      <category domain="http://www.technorati.com/tag">subversion</category>
      <category domain="http://www.technorati.com/tag">ubuntu</category>
    </item>
    <item>
      <title>Putting mysql scripts in subversion</title>
      <link>http://www.petersblog.org/node/view/959</link>
      <description>&lt;p&gt;
I have developed my strategy for putting &lt;a href="/tag/drupal"&gt;drupal&lt;/a&gt; database dumps into &lt;a href="/tag/subversion"&gt;subversion&lt;/a&gt; every day. This was slightly more complicated than I though it would be. In principle I could just use mysqldump to dump the sql and put that in subversion but the problem is that mysqldump by default will output the insert statements to reconstruct a table in a single line in the file, even of that line grows to 600k long. If subversion does a line-by-line diff on the files it stores it will end up writing all 600k to it's transaction log. 
&lt;/p&gt;
&lt;p&gt;
To minimise the sizes of each diff I dump the mysql in two parts, the data and the structure. For the data dump I do the following: 
&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;
use --skip-opt to ensure that each row is inserted on a seperate line: this limits the line length. The --opt option is the default for my version of mysql (4.1.13) so I have to turn it off. 
&lt;/li&gt;
&lt;li&gt;
remove comments 
&lt;/li&gt;
&lt;li&gt;
strip out data for the 'accesslog', 'cache', 'search_index' and 'sessions' tables. I don't think these need backing up. 
&lt;/li&gt;
&lt;li&gt;
sort the remaining lines into alphabetical order as I am not sure the sql dump is guaranteed to always dump the rows in the same order 
&lt;/li&gt;&lt;/ul&gt;

&lt;p&gt;
The structure is dumped straight, I certainly don't sort the lines in the file! 
&lt;/p&gt;
&lt;p&gt;
This creates sql data files that should diff pretty optimally. 
&lt;/p&gt;
&lt;p&gt;
Here is the bash script that does this for me: 
&lt;/p&gt;
&lt;pre class="lazy"&gt;&lt;span class="line-numbers"&gt;   1 &lt;/span&gt; &lt;span class="Comment"&gt;&lt;span class="Comment"&gt;#&lt;/span&gt;!/bin/bash&lt;/span&gt;
&lt;span class="line-numbers"&gt;   2 &lt;/span&gt; 
&lt;span class="line-numbers"&gt;   3 &lt;/span&gt; function SqlDumpData {
&lt;span class="line-numbers"&gt;   4 &lt;/span&gt;     mysqldump -u secret -psecret --no-create-info --skip-opt --comments=0 &lt;span class="Variable"&gt;&lt;span class="Variable"&gt;$&lt;/span&gt;1&lt;/span&gt; &lt;span class="Keyword"&gt;|&lt;/span&gt; \
&lt;span class="line-numbers"&gt;   5 &lt;/span&gt;       egrep -v &lt;span class="String"&gt;&lt;span class="String"&gt;&amp;quot;&lt;/span&gt;INSERT INTO &lt;span class="Constant"&gt;\`&lt;/span&gt;(accesslog|cache|search_index|sessions)&lt;span class="Constant"&gt;\`&lt;/span&gt;&lt;span class="String"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class="Keyword"&gt;|&lt;/span&gt; sort &lt;span class="Keyword"&gt;&amp;gt;&lt;/span&gt;&lt;span class="Variable"&gt;&lt;span class="Variable"&gt;$&lt;/span&gt;2&lt;/span&gt;
&lt;span class="line-numbers"&gt;   6 &lt;/span&gt; }
&lt;span class="line-numbers"&gt;   7 &lt;/span&gt; 
&lt;span class="line-numbers"&gt;   8 &lt;/span&gt; function SqlDumpStructure {
&lt;span class="line-numbers"&gt;   9 &lt;/span&gt;     mysqldump -u secret -psecret --no-data &lt;span class="Variable"&gt;&lt;span class="Variable"&gt;$&lt;/span&gt;1&lt;/span&gt; &lt;span class="Keyword"&gt;&amp;gt;&lt;/span&gt;&lt;span class="Variable"&gt;&lt;span class="Variable"&gt;$&lt;/span&gt;2&lt;/span&gt;
&lt;span class="line-numbers"&gt;  10 &lt;/span&gt; }
&lt;span class="line-numbers"&gt;  11 &lt;/span&gt; 
&lt;span class="line-numbers"&gt;  12 &lt;/span&gt; cd /home/peterc/DatabaseDumps
&lt;span class="line-numbers"&gt;  13 &lt;/span&gt; 
&lt;span class="line-numbers"&gt;  14 &lt;/span&gt; SqlDumpData petersblog petersblog_data.sql
&lt;span class="line-numbers"&gt;  15 &lt;/span&gt; 
&lt;span class="line-numbers"&gt;  16 &lt;/span&gt; SqlDumpStructure petersblog petersblog_structure.sql
&lt;span class="line-numbers"&gt;  17 &lt;/span&gt; 
&lt;span class="line-numbers"&gt;  18 &lt;/span&gt; svn commit -m &lt;span class="String"&gt;&lt;span class="String"&gt;&amp;quot;&lt;/span&gt;daily backup&lt;span class="String"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
&lt;/pre&gt;
&lt;p&gt;
This is all done on the server. Following this I can use my &lt;a href="/node/957"&gt;standard strategy&lt;/a&gt; to backup the subversion repository. 
&lt;/p&gt;
&lt;p&gt;
I have tested that the sql dumps can be reimported into mysql and give a functioning website. 
&lt;/p&gt;&lt;p&gt;Related Posts: &lt;a href="/tag/backup"&gt;backup&lt;/a&gt; &lt;a href="/tag/drupal"&gt;drupal&lt;/a&gt; &lt;a href="/tag/mysql"&gt;mysql&lt;/a&gt; &lt;a href="/tag/subversion"&gt;subversion&lt;/a&gt;&lt;/p&gt;</description>
      <guid>http://www.petersblog.org/node/view/959</guid>
      <category domain="http://www.technorati.com/tag">backup</category>
      <category domain="http://www.technorati.com/tag">drupal</category>
      <category domain="http://www.technorati.com/tag">mysql</category>
      <category domain="http://www.technorati.com/tag">subversion</category>
    </item>
    <item>
      <title>Subversion Notes</title>
      <link>http://www.petersblog.org/node/view/950</link>
      <description>&lt;p&gt;
I have put my &lt;a href="/tag/drupal"&gt;drupal&lt;/a&gt; stuff under subversion for some source control so I can unify the source of three separate installations. In theory I could use drupal's virtual hosting features and have a single set of drupal files but: 
&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;
I want these installations to have seperate files and images directories and drupals virtual hosting does not support this 
&lt;/li&gt;
&lt;li&gt;
I want apache2 to control all my virtual hosting. 
&lt;/li&gt;
&lt;li&gt;
I want my own drupal hacks under source control 
&lt;/li&gt;&lt;/ul&gt;

&lt;p&gt;
Some notes on how I did this: 
&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;
Create temporary copies of files I want submitted to subversion: 
&lt;pre class="lazy"&gt;mkdir &lt;span class="Keyword"&gt;~&lt;/span&gt;/drupal
mkdir &lt;span class="Keyword"&gt;~&lt;/span&gt;/drupal/trunk
cp -r /var/www/petersblog.org/* /var/www/petersblog.org/.htaccess &lt;span class="Keyword"&gt;~&lt;/span&gt;/drupal/trunk
&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
remove stuff I don't want shared with other drupal installations: 
&lt;pre class="lazy"&gt;rm -r &lt;span class="Keyword"&gt;~&lt;/span&gt;/drupal/trunk/files
rm -r &lt;span class="Keyword"&gt;~&lt;/span&gt;/drupal/trunk/images
rm -r &lt;span class="Keyword"&gt;~&lt;/span&gt;/drupal/trunk/sites
rm -r &lt;span class="Keyword"&gt;~&lt;/span&gt;/drupal/trunk/favicon.ico
&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
Put into subversion: 
&lt;pre class="lazy"&gt;svn import &lt;span class="Keyword"&gt;~&lt;/span&gt;/drupal file:///repository_name/drupal -m &lt;span class="String"&gt;&lt;span class="String"&gt;&amp;quot;&lt;/span&gt;First Import&lt;span class="String"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
Get out of subversion again: 
&lt;pre class="lazy"&gt;mkdir /var/www/petersblog2.org
cd /var/www/petersblog2.org
svn checkout file:///repository_name/trunk/drupal .
&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
Since that worked ok, the copies of the files I created to put into subversion can now be zapped: 
&lt;pre class="lazy"&gt;rm -r &lt;span class="Keyword"&gt;~&lt;/span&gt;/drupal
&lt;/pre&gt;
If there is one thing I do not like about subversion it is this 'trunk' directory thing. I know it is not a requirement but just a convention but still. 
&lt;/li&gt;
&lt;li&gt;
restore non-archived files 
&lt;pre class="lazy"&gt;cp -r /var/www/petersblog.org/files /var/www/petersblog2.org/files
cp -r /var/www/petersblog.org/images /var/www/petersblog2.org/images
cp -r /var/www/petersblog.org/sites /var/www/petersblog2.org/sites
cp -r /var/www/petersblog.org/favicon.ico /var/www/petersblog2.org
&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
set up subversion to ignore these files that I don't want under svn control. After this running &lt;code&gt;svn status&lt;/code&gt; will not list these files and subversion will not attempt to add them to the archive: 
&lt;pre class="lazy"&gt;svn propedit svn:ignore .
files
images
sites
favicon.ico
&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
commit changes, namely the changes to the svn:ignore properties 
&lt;pre class="lazy"&gt;svn commit -m &lt;span class="String"&gt;&lt;span class="String"&gt;&amp;quot;&lt;/span&gt;Ignore files I do not want shared&lt;span class="String"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
make sure my new copy has everything: 
&lt;pre class="lazy"&gt;diff -r --exclude=.svn /var/www/petersblog.org /var/www/petersblog2.org
&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
change to the new site archive 
&lt;pre class="lazy"&gt;cd ..
mv petersblog.org petersblog_presvn.org
mv petersblog2.org petersblog.org
&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
list anything that has changed: 
&lt;pre class="lazy"&gt;cd /var/www/petersblog.org
svn status
&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
Get the code out on a new site: 
&lt;pre class="lazy"&gt;mkdir /var/www/newsite
cd /var/www/newsite
svn checkout file:///repository_name/trunk/drupal .
&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
After modifying the archive, get latest code out of subversion: 
&lt;pre class="lazy"&gt;svn update
&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
Put changes to code into subversion: 
&lt;pre class="lazy"&gt;svn commit -m &lt;span class="String"&gt;&lt;span class="String"&gt;&amp;quot;&lt;/span&gt;did some hacking&lt;span class="String"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
&lt;/pre&gt;
&lt;/li&gt;&lt;/ul&gt;

&lt;p&gt;
&lt;a href="http://www.abbeyworkshop.com/howto/misc/svn01/"&gt;this cheat sheet&lt;/a&gt; was useful. 
&lt;/p&gt;&lt;p&gt;Related Posts: &lt;a href="/tag/drupal"&gt;drupal&lt;/a&gt; &lt;a href="/tag/subversion"&gt;subversion&lt;/a&gt;&lt;/p&gt;</description>
      <guid>http://www.petersblog.org/node/view/950</guid>
      <category domain="http://www.technorati.com/tag">drupal</category>
      <category domain="http://www.technorati.com/tag">subversion</category>
    </item>
    <item>
      <title>Subversion</title>
      <link>http://www.petersblog.org/node/view/827</link>
      <description>&lt;p&gt;
I've been looking at &lt;a href="http://subversion.tigris.org/"&gt;Subversion&lt;/a&gt; for Source Control and am liking what I see. The documentation is really good, it has enlightened me about the copy-modify-merge methodology and how much nicer it is than the laborious lock-modify-unlock method I use in Visual SourceSafe. It seems that merges are not to be dreaded, they are rare and subversion will not try to automatically munge together two sets of code and generate a mess that won't build. The users are left to resolve merges themselves which is easy if you are the only user &lt;img alt="smile" src="/images/smileys/smile.png" /&gt; 
&lt;/p&gt;
&lt;p&gt;
There is even a cool &lt;a href="http://tortoisesvn.tigris.org/"&gt;Windows Explorer extension&lt;/a&gt; to manage files. 
&lt;/p&gt;
&lt;p&gt;
I am contemplating putting my &lt;a href="tags/ubuntu"&gt;Ubuntu&lt;/a&gt; configuration under Source Control. The advantages are: 
&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;
configuration is backed up 
&lt;/li&gt;
&lt;li&gt;
each change I, debconf, webmin or whatever makes to the configuration can be encapsulated in a changeset. 
&lt;/li&gt;
&lt;li&gt;
I can easily recall precisely what I had to edit to solve a particular problem. 
&lt;/li&gt;&lt;/ul&gt;

&lt;p&gt;
The only problem I can anticipate is Subversion fiddling around with file permissions, as is normally the case with the lock-modify-unlock model. Maybe copy-modify-merge does not need this? Restoring an old configuration setup is very likely to mess up permissions but hopefully that would rarely be necessary and can be done in a controlled manner. 
&lt;/p&gt;
&lt;p&gt;
Being responsible for the IT systems at work, I don't see why the configurations should not be under the same change control as the software we write is. Unfortunatly our servers are mostly Windows so we cannot simply archive the /etc directory &lt;img alt="sad" src="/images/smileys/sad.png" /&gt; 
&lt;/p&gt;&lt;p&gt;Related Posts: &lt;a href="/tag/linux"&gt;linux&lt;/a&gt; &lt;a href="/tag/subversion"&gt;subversion&lt;/a&gt; &lt;a href="/tag/ubuntu"&gt;ubuntu&lt;/a&gt;&lt;/p&gt;</description>
      <guid>http://www.petersblog.org/node/view/827</guid>
      <category domain="http://www.technorati.com/tag">linux</category>
      <category domain="http://www.technorati.com/tag">subversion</category>
      <category domain="http://www.technorati.com/tag">ubuntu</category>
    </item>
  </channel>
</rss>
