<?xml version="1.0" encoding="UTF-8"?>
<feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom">
  <title>andthennothing.net: Tag writeup</title>
  <subtitle type="html">&amp;ldquo;first there was a three-legged monkey...&amp;rdquo;</subtitle>
  <id>tag:www.andthennothing.net,2005:Typo</id>
  <generator uri="http://typo.leetsoft.com" version="4.0">Typo</generator>
  <link href="http://www.andthennothing.net/xml/atom10/tag/writeup/feed.xml" rel="self" type="application/xml+atom"/>
  <link href="http://www.andthennothing.net/tags/writeup?tag=writeup" rel="alternate" type="text/html"/>
  <updated>2006-10-11T12:45:53+00:00</updated>
  <entry>
    <author>
      <name>Jonas Bengtsson</name>
      <email>jonas.b@home.se</email>
    </author>
    <id>urn:uuid:d91c76f6-0ca9-4519-b3c1-c1d9d5ff1f8c</id>
    <published>2005-10-22T14:19:00+00:00</published>
    <updated>2006-10-11T12:45:53+00:00</updated>
    <title>rake migrate</title>
    <link href="http://www.andthennothing.net/archives/2005/10/22/rake-migrate" rel="alternate" type="text/html"/>
    <category term="mysql" scheme="http://www.andthennothing.net/tags/writeup"/>
    <category term="rails" scheme="http://www.andthennothing.net/tags/writeup"/>
    <category term="typo" scheme="http://www.andthennothing.net/tags/writeup"/>
    <category term="writeup" scheme="http://www.andthennothing.net/tags/writeup"/>
    <content type="html">&lt;p&gt;This is the first time I&amp;#8217;m updating my &lt;a href="http://typo.leetsoft.com/"&gt;Typo&lt;/a&gt; installation, and the update contains changes to the database schema as well to make things a little bit more interesting.&lt;/p&gt;


I start by backing up my MySQL database:
&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;$ mysqldump -C -u username -p --opt --lock-tables=false --skip-add-locks --skip-extended-insert database &amp;gt; dump.sql&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

	&lt;p&gt;I fetch the dump to my laptop and bring it into my local MySQL server (using &lt;a href="http://www.sqlyog.com/"&gt;SQLyog&lt;/a&gt;, but could just as well have used MySQL directly). Updating to latest version of Typo.&lt;/p&gt;


&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;svk sync --all
svk update andthennothing-dev
svk smerge //typo/mirror andthennothing-dev
svk commit andthennothing-dev&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

	&lt;p&gt;When I try to run Typo now it doesn&amp;#8217;t work since the database schema has changed. This is where &lt;a href="http://wiki.rubyonrails.com/rails/pages/ActiveRecordMigration"&gt;Active Record&amp;#8217;s Migrations&lt;/a&gt; come in. It should be as easy as &lt;code&gt;rake migrate&lt;/code&gt;, but it wasn&amp;#8217;t for me. Not this time. First I try it out on my laptop and since the Typo user doesn&amp;#8217;t have all permissions needed some of the migration steps don&amp;#8217;t succeed (that&amp;#8217;s at least what I think went wrong). However, after changing the permissions of the user, changing &lt;code&gt;schema_info.version&lt;/code&gt; to 18 (the version it was before I tried to migrate) and re-restoring the dumped database it works as expected.&lt;/p&gt;


	&lt;p&gt;Since I don&amp;#8217;t want the same problem on my production server I create a test database and checkout the new Typo version in a temporary directory on the server. But it failed in another way:&lt;/p&gt;


&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;$ rake migrate RAILS_ENV=test
rake aborted!
WARNING:  You have a nil object when you probably didn't expect it!  Odds are you want an instance of Array instead.

Look in the callstack to see where you're working with an object that could be nil.
Investigate your methods and make sure the object is what you expect!
./rakefile:218&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

	&lt;p&gt;The reason was that the &lt;code&gt;schema_info&lt;/code&gt; table somehow was empty, don&amp;#8217;t know how it happened. But adding a record with &lt;code&gt;version&lt;/code&gt; = 18, the migration works.&lt;/p&gt;


	&lt;p&gt;After some testing locally of the new version I&amp;#8217;m ready to push the new version to the production server. Merge dev to trunk locally:&lt;/p&gt;


&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;svk update andthennothing-trunk
svk smerge //andthennothing/branches/dev andthennothing-trunk
svk commit andthennothing-trunk&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

On the server (I still have the database dump if anything should go wrong):
&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;$ killall lighttpd # I think I'll manage some downtime
$ svn update
$ rake migrate RAILS_ENV=production
Trying to add whiteboard to: articles... comments... pages... done.
Renaming Articles table
Copying article data
Adding a type column
Extending Content table
Converting comments
Extending Content table
Converting trackbacks
Extending content table
Converting pages
Updating all articles
$ #restart lighttpd&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

	&lt;p&gt;Everything seems to work just fine! The update took something like one or two minutes I think, which is quite an acceptable downtime on a personal web site. I will look into how to update without any downtime some other time since I think it&amp;#8217;s possible with &lt;a href="http://www.rubyonrails.org"&gt;Rails&lt;/a&gt;.&lt;/p&gt;


	&lt;p&gt;It was a quite painless experience once I figured out how to get around the problems, and I&amp;#8217;m glad I tried it out locally first. Rails Migrations rocks! The only objection I have is why it didn&amp;#8217;t perform the migration in a transation so when it failed the first time it wouldn&amp;#8217;t have screwed up my database?&lt;/p&gt;


	&lt;p&gt;&lt;ins&gt;Update:&lt;/ins&gt; The transaction problem is &lt;a href="http://typo.leetsoft.com/trac/changeset/690"&gt;fixed by scott&lt;/a&gt;.&lt;/p&gt;</content>
  </entry>
  <entry>
    <author>
      <name>Jonas Bengtsson</name>
      <email>jonas.b@home.se</email>
    </author>
    <id>urn:uuid:a58ec083-ecb9-49e1-a5bd-126307a9de92</id>
    <published>2005-10-22T12:37:00+00:00</published>
    <updated>2005-12-18T03:19:08+00:00</updated>
    <title>Relocating svk mirrors</title>
    <link href="http://www.andthennothing.net/archives/2005/10/22/relocating-svk-mirrors" rel="alternate" type="text/html"/>
    <category term="svn" scheme="http://www.andthennothing.net/tags/writeup"/>
    <category term="svk" scheme="http://www.andthennothing.net/tags/writeup"/>
    <category term="writeup" scheme="http://www.andthennothing.net/tags/writeup"/>
    <content type="html">&lt;p&gt;&lt;a href="http://andthennothing.net/archives/2005/10/01/handling-multiple-repositories-with-svn-and-svk"&gt;When I created my svk mirrors&lt;/a&gt; I used http to connect to my svn repository. However since then I activated https support on my server. Due to some stupidity on my part (and how hard it is to debug webserver configuration problems) I didn&amp;#8217;t get it to work until this week (thanks to the &lt;a href="http://www.textdrive.com"&gt;TextDrive support&lt;/a&gt;). To relocate a mirror you should just have to do like this:&lt;/p&gt;


&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;C:\&amp;gt;svk mirror --list
Path                    Source
============================================================
//andthennothing        http://urltorepository
//typo/mirror           svn://leetsoft.com/typo/trunk
C:\&amp;gt;svk mirror --relocate //andthennothing https://urltorepository&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

But I wouldn&amp;#8217;t write this if it was that painless. I got this error instead:
&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;C:\&amp;gt;svk mirror --relocate //andthennothing https://urltorepository
Error validating server certificate for 'https://hostname:443':
&amp;lt;snip /&amp;gt;
(R)eject, accept (t)emporarily or accept (p)ermanently? p
Type error in argument 2 of svn_auth_cred_ssl_server_trust_t_accepted_failures_set. Expected _p_apr_uint32_t at C:/Development/svk/lib/SVN/Base.pm line 80, &amp;lt;STDIN&amp;gt; line 1.&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

After a while of searching darix at the &lt;a href="irc://irc.freenode.net/svn"&gt;#svn&lt;/a&gt; helped me out.
&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;C:\&amp;gt;svn ls https://urltorepository
Error validating server certificate for 'https://hostname:443':
&amp;lt;snip /&amp;gt;
(R)eject, accept (t)emporarily or accept (p)ermanently? p
branches/
trunk/
C:\&amp;gt;svk mirror --relocate //andthennothing https://urltorepository
Authentication realm: &amp;lt;https://hostname:443&amp;gt; realm
Password for 'user':
Committed revision 633.
C:\&amp;gt;svk mirror --list
Path                    Source
============================================================
//andthennothing        https://urltorepository
//typo/mirror           svn://leetsoft.com/typo/trunk&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

	&lt;p&gt;Yay! So I guess there&amp;#8217;s some problems with adding a certificate through svk at least on Windows (more specifically &lt;a href="http://svn.haxx.se/users/archive-2005-04/1247.shtml"&gt;svn&amp;#8217;s Perl bindings on Windows&lt;/a&gt;). But as soon as the certificate is cached (through svn) everything works fine.&lt;/p&gt;


	&lt;p&gt;I feel so much secure now using https instead of http :-)&lt;/p&gt;


	&lt;p&gt;&lt;ins&gt;Update:&lt;/ins&gt; To relocate a svn checkout you just type &lt;code&gt;svn switch https://urltorepository&lt;/code&gt;. Easy peasy!&lt;/p&gt;</content>
  </entry>
  <entry>
    <author>
      <name>Jonas Bengtsson</name>
      <email>jonas.b@home.se</email>
    </author>
    <id>urn:uuid:3067c42b-7001-4a39-b07d-b5a8d0441256</id>
    <published>2005-10-01T19:46:00+00:00</published>
    <updated>2005-12-18T03:19:02+00:00</updated>
    <title>Handling multiple repositories with svn and svk</title>
    <link href="http://www.andthennothing.net/archives/2005/10/01/handling-multiple-repositories-with-svn-and-svk" rel="alternate" type="text/html"/>
    <category term="svn" scheme="http://www.andthennothing.net/tags/writeup"/>
    <category term="svk" scheme="http://www.andthennothing.net/tags/writeup"/>
    <category term="scm" scheme="http://www.andthennothing.net/tags/writeup"/>
    <category term="typo" scheme="http://www.andthennothing.net/tags/writeup"/>
    <category term="writeup" scheme="http://www.andthennothing.net/tags/writeup"/>
    <content type="html">&lt;p&gt;On a day-to-day basis I&amp;#8217;m using &lt;a href="http://www.perforce.com/"&gt;Perforce&lt;/a&gt; at work for my &lt;acronym title="Software Configuration Management"&gt;SCM&lt;/acronym&gt; needs. I&amp;#8217;ve used &lt;a href="http://www.cvshome.org"&gt;CVS&lt;/a&gt; a few times back in the days but I&amp;#8217;ve tried to forget about it :-). But as I&amp;#8217;m migrating to my new web host I have to learn how to use Subversion (svn). The main issue I saw was how to manage multiple branches and repositories.&lt;/p&gt;


	&lt;p&gt;I asked at the &lt;a href="http://typo.leetsoft.com/"&gt;Typo&lt;/a&gt; mailing list, and a similar thread appeared on the &lt;a href="http://www.rubyonrails.org/"&gt;Rails&lt;/a&gt; mailing list, and the general recommendation was to use &lt;a href="http://svk.elixus.org/"&gt;svk&lt;/a&gt; (especially &lt;a href="http://article.gmane.org/gmane.comp.lang.ruby.rails/23701"&gt;this mail&lt;/a&gt; won me over). Other reference material I used was &lt;a href="http://scottstuff.net/blog/articles/2005/07/07/distributed-development-with-svk"&gt;this&lt;/a&gt;, &lt;a href="http://svk.elixus.org/"&gt;that&lt;/a&gt;, and &lt;a href="http://svnbook.red-bean.com/"&gt;the other&lt;/a&gt;. This is a writeup of how I went about &lt;em&gt;(it might not be that easy to understand and a little more explanations are probably needed for this to be helpful, but just ask me if there is something that you don&amp;#8217;t understand)&lt;/em&gt;:&lt;/p&gt;


	&lt;p&gt;Installing svk from &lt;a href="http://svk.elixus.org/?SVKWin32"&gt;here&lt;/a&gt;.&lt;/p&gt;


&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;svk depotmap --init
svk mkdir //typo
svk mirror svn://leetsoft.com/typo/trunk //typo/mirror
svk sync //typo/mirror
svk co //typo/mirror typo-mirror&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

	&lt;p&gt;Seems to work.&lt;/p&gt;


	&lt;p&gt;I&amp;#8217;m a little bit worried at this stage. I&amp;#8217;d like to use the &lt;a href="http://www.eclipse.org/"&gt;Eclipse&lt;/a&gt; plugin &lt;a href="http://subclipse.tigris.org"&gt;subclipse&lt;/a&gt; when developing. Perhaps I should only use svk when migrating between different trees. Yes, I think I&amp;#8217;ll go for that, and to make it smooth I&amp;#8217;ll keep all svk checkouts (&lt;code&gt;svk co --list&lt;/code&gt;) in one directory called &lt;code&gt;svk&lt;/code&gt;. So let&amp;#8217;s relocate:&lt;/p&gt;


&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;svk co --relocate typo-mirror svk\typo-mirror&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

	&lt;p&gt;I might change my mind further down the line and want to use svk exclusively, but I don&amp;#8217;t expect that to be a problem since svk appears to be quite flexible.&lt;/p&gt;


	&lt;p&gt;Time to move into svn land. I need to create a trunk and a development tree on my Textdrive repository.&lt;/p&gt;


&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;svn mkdir http://urltorepository/trunk
svn mkdir http://urltorepository/branches
svn mkdir http://urltorepository/branches/dev&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

Time to chechout the svn branches:
&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;svn co http://urltorepository/trunk site-trunk
svn co http://urltorepository/branches/trunk site-dev&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

	&lt;p&gt;Back in svk land.&lt;/p&gt;


&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;svk mirror http://urltorepository //site
svk sync //site
svk co //site/branches/dev site-dev&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

	&lt;p&gt;Time to do a baseless merge from Typo to the dev branch:&lt;/p&gt;


&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;svk smerge --baseless //typo/mirror site-dev&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

	&lt;p&gt;Since the dev branch was empty before it&amp;#8217;s safe to commit the changes without reviewing: &lt;code&gt;svk commit&lt;/code&gt;.&lt;/p&gt;


	&lt;p&gt;Time to update Typo with the changes I&amp;#8217;ve done previously. &lt;code&gt;svn update&lt;/code&gt; in my site-dev checkout. Firing up a favourite open source utility of mine: &lt;a href="http://winmerge.org/"&gt;WinMerge&lt;/a&gt;. Takes a while to merge all the files, but now I&amp;#8217;m done, just have to try out if it works alright. It seems to work fine. &lt;code&gt;svn status&lt;/code&gt;. Hmm, most of my customizations of Typo is in the views, and looking at this &lt;a href="http://typo.leetsoft.com/trac/ticket/354"&gt;ticket&lt;/a&gt; Typo is apparently supporting themed views, have to try it out&amp;#8230; Yes it works, neato! &lt;code&gt;svn add&lt;/code&gt; on all the new files and &lt;code&gt;svn commit&lt;/code&gt;.&lt;/p&gt;


Back to svk to integrate to the trunk. 
&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;svk sync //site
svk co //site/trunk andthennothing-trunk&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

Migrating from the dev branch to trunk: 
&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;svk smerge --baseless //site/branches/dev site-trunk
svk commit&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

	&lt;p&gt;I think that&amp;#8217;s it and hope it will be quite easy to manage in the future. There are two main cycles I&amp;#8217;ll be performing. One is getting updates from the Typo repository, and then migrate the changes to the dev branch to the trunk. The other one is migrating changes I&amp;#8217;m doing to the dev branch to the trunk. Both of those should be quite easy to manage in svk. I think that the dev branch might be unnecessary, but I&amp;#8217;m used to working with a lot of different branches (release, import, team, personal etc.) so that&amp;#8217;s how I&amp;#8217;m feeling comfortable at the moment. But it will probably be quite easy to remove the dev branch if deemed unnecessary.&lt;/p&gt;


	&lt;p&gt;Both svn and svk are new and welcomed acquaintances. Working in the command prompt with &lt;span class="caps"&gt;SCM&lt;/span&gt; tools were nicer than I thought and remembered. Hopefully I will have the same opinion in a couple of weeks when I have a little more experience with merging and resolving conflicts (I&amp;#8217;m somewhat worried that it will be cumbersome). svn&amp;#8217;s poor support for branches and merging is my main pet peeve, but svk handled that nicely. I would go for a svk only (on the client side) if there were a Eclipse plug-in.&lt;/p&gt;


	&lt;p&gt;Nice learning experience!&lt;/p&gt;</content>
  </entry>
  <entry>
    <author>
      <name>Jonas Bengtsson</name>
      <email>jonas.b@home.se</email>
    </author>
    <id>urn:uuid:39883d6d-9245-46f7-80f7-1ea795107108</id>
    <published>2005-02-03T20:16:00+00:00</published>
    <updated>2005-12-18T03:19:04+00:00</updated>
    <title>MoveableType installation exercise</title>
    <link href="http://www.andthennothing.net/archives/2005/02/03/moveabletype-installation-exercise" rel="alternate" type="text/html"/>
    <category term="writeup" scheme="http://www.andthennothing.net/tags/writeup"/>
    <category term="installation" scheme="http://www.andthennothing.net/tags/writeup"/>
    <content type="html">&lt;p&gt;So here is my &amp;#8220;guide&amp;#8221; to installing &lt;a href="http://www.moveabletype.org/"&gt;MoveableType&lt;/a&gt; (MT). I have actually installed MT once before and remeber it beeing somewhat cumbersome. I&amp;#8217;m about to install MT not to use it but as an exercise.&lt;/p&gt;


	&lt;p&gt;So I have a quite freshly installed computer with WinXP Pro. I have installed &lt;a href="http://www.apachefriends.org/en/xampp.html"&gt;XAMPP&lt;/a&gt; before, which is as easy as it gets. I didn&amp;#8217;t get the &lt;a href="http://www.perl.com/"&gt;Perl&lt;/a&gt; add-on, so that&amp;#8217;s my first step. A hefty download and a lot of small files to install, so I can relax to the sound of the &lt;a href="http://live.curry.com/newsItems/departments/dailySourceCode"&gt;Daily Sourcecode&lt;/a&gt; (DSC) podcast&amp;#8230; But the install is (almost) one-click, so no worries.&lt;/p&gt;


	&lt;p&gt;No idea if Perl (and Perl-&lt;a href="http://httpd.apache.org/"&gt;Apache&lt;/a&gt; collaboration) works yet, but there&amp;#8217;s no reason why it shouldn&amp;#8217;t. So I head off to &lt;a href="http://www.moveabletype.org/"&gt;MT&amp;#8217;s site&lt;/a&gt; and download&amp;#8230; and downloaaaad&amp;#8230; Hmm&amp;#8230; Their site is really slow. And download the &amp;#8220;Limited Free Version&amp;#8221; (1 author, 3 weblogs), which will do since I&amp;#8217;m just trying it out. Need to &lt;a href="https://www.typekey.com/t/typekey/register"&gt;register&lt;/a&gt; (or &lt;a href="http://www.bugmenot.com/view.php?url=www.typekey.com"&gt;&amp;#8220;register&amp;#8221;&lt;/a&gt;) for the download. (And now &lt;span class="caps"&gt;DSC&lt;/span&gt; is over)&lt;/p&gt;


	&lt;p&gt;Looking at the &lt;code&gt;/docs/mtinstall.html&lt;/code&gt; file in the .zip file. Hmmm&amp;#8230; I see. By the way, I have a little itch, that I didn&amp;#8217;t check if Perl works alright, so I go to &lt;code&gt;http://localhost/xampp/perl-info.php&lt;/code&gt; and see that everything seems to work. Now it&amp;#8217;s time to continue with the installation.&lt;/p&gt;


	&lt;p&gt;It&amp;#8217;s seems like the Perl installation installed three ways of running Perl scripts. &lt;a href="http://perl.apache.org/"&gt;modperl&lt;/a&gt; which I guess is quite efficient, modperlasp (&lt;a href="http://www.apache-asp.org/"&gt;Apache::ASP&lt;/a&gt; I think) which seems to have a &lt;span class="caps"&gt;ASP&lt;/span&gt;-like syntax, and than old trustworthy &lt;span class="caps"&gt;CGI&lt;/span&gt;. The main difference between modperl and running &lt;span class="caps"&gt;CGI&lt;/span&gt; is that I suspect that modperl fires up one (or more?) instances of Perl which Apache uses for every page view, whereas it has to start a new instance of Perl for each page view when using &lt;span class="caps"&gt;CGI&lt;/span&gt;. I don&amp;#8217;t know much about Perl and Apache, but that&amp;#8217;s my bet. But since the MT scripts are .cgi I think &lt;span class="caps"&gt;CGI&lt;/span&gt; is the (only?) way to go. As &lt;span class="caps"&gt;XAMPP&lt;/span&gt;&amp;#8217;s &lt;code&gt;perl-info.php&lt;/code&gt; page states, the &lt;span class="caps"&gt;CGI&lt;/span&gt; directory is &lt;code&gt;\xampp\cgi-bin\&lt;/code&gt;. So as I understand it now, the .cgi files should go in to the &lt;code&gt;cgi-bin&lt;/code&gt; directory, and the other files should be elsewhere. You could probably also create a new directory and enable &lt;span class="caps"&gt;CGI&lt;/span&gt; on that directory, but let&amp;#8217;s at least start with just using the existing &lt;code&gt;cgi-bin&lt;/code&gt; directory (I&amp;#8217;m not that fond of messing with Apache&amp;#8217;s &lt;code&gt;httpd.conf&lt;/code&gt; file).&lt;/p&gt;


	&lt;p&gt;But then again, I&amp;#8217;m just installing MT to try it out, and the documentation is a bit vague on which file to place where, so let&amp;#8217;s create a new directory &lt;code&gt;\xampp\htdocs\mt&lt;/code&gt; and extract everything from the installation .zip file. Then I update the shebang (the first line) of the .cgi files to &lt;code&gt;#!I:\development\xampp\perl\bin\perl -w&lt;/code&gt;. Without it, Apache won&amp;#8217;t know where to find Perl to execute the scripts.&lt;/p&gt;


	&lt;p&gt;I will use the &lt;a href="http://www.mysql.com/"&gt;MySQL&lt;/a&gt; server functionality, which shouldn&amp;#8217;t be a problem since &lt;span class="caps"&gt;XAMPP&lt;/span&gt; installed it for me earlier. (You have to do some extra steps here if you use the other options). Hmm&amp;#8230; The guide talks something about setting up &amp;#8220;[y]our weblog directories&amp;#8221;. I guess that&amp;#8217;s where the actual blog(s) will be generated (i.e. the output directory/ies). But I skip that step. :-)&lt;/p&gt;


So let&amp;#8217;s start editing &lt;code&gt;mt.cfg&lt;/code&gt;:
&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;CGIPath http://localhost/mt/
ObjectDriver DBI::mysql
Database mt
DBUser username
DBHost localhost&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

	&lt;p&gt;I called the database &lt;code&gt;mt&lt;/code&gt; so let&amp;#8217;s start &lt;a href="http://www.phpmyadmin.net/"&gt;PHPMyAdmin&lt;/a&gt; and add the database. &lt;code&gt;http://localhost/phpmyadmin/&lt;/code&gt; &amp;ndash;&amp;gt; Create new database &amp;ndash;&amp;gt; &lt;code&gt;mt&lt;/code&gt; &amp;ndash;&amp;gt; Create. Done. I think that should be enough, so I save the &lt;code&gt;mt.cfg&lt;/code&gt;. And change the database password in &lt;code&gt;mt-db-pass.cgi&lt;/code&gt; (you can set the MySQL password in &lt;code&gt;http://localhost/xampp/xamppsecurity.php&lt;/code&gt;). I don&amp;#8217;t like saving the password in plain text :-(.&lt;/p&gt;


	&lt;p&gt;Hmm&amp;#8230; So now I have to set the permissions on the files. Not really sure what to do with this one. I&amp;#8217;m on Windows remember? Not that there are no permissions in Windows, but I skip this step for not.. Hush, don&amp;#8217;t tell anyone :-)&lt;/p&gt;


	&lt;p&gt;Let&amp;#8217;s check the &lt;code&gt;mt-check.cgi&lt;/code&gt; to see if everything is ok. &lt;code&gt;http://localhost/mt/mt-check.cgi&lt;/code&gt;. Yikes. It seems like it worked. &amp;#8220;Movable Type System Check Successful&amp;#8221;. I thought I had to do something for Apache to execute the script, you see my Apache fu is weak. A few of the optional modules were missing, so I&amp;#8217;ll look at that later perhaps.&lt;/p&gt;


	&lt;p&gt;Now I&amp;#8217;m supposed to run &lt;code&gt;mt-load.cgi&lt;/code&gt;. Fingers crossed. &lt;code&gt;http://localhost/mt/mt-load.cgi&lt;/code&gt;. Finally, an error, everything worked too smoothly.&lt;/p&gt;


	&lt;blockquote&gt;
		&lt;p&gt;Bad ObjectDriver config: Connection error: Client does not support authentication protocol requested by server; consider upgrading MySQL client&lt;/p&gt;
	&lt;/blockquote&gt;


	&lt;p&gt;Hmmm&amp;#8230;. Didn&amp;#8217;t see this one coming though. Ouch, my Perl fu is weak as well. I wonder if there is anything like irb for &lt;a href="http://www.ruby-lang.org/en/"&gt;Ruby&lt;/a&gt; or &lt;a href="http://www.python.org/'s"&gt;Python&lt;/a&gt; interactive shell.&lt;/p&gt;


Found a little script that I changed somewhat:
&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_perl "&gt;#!I:\development\xampp\perl\bin\perl -w
use DBI;
my $db;
$db = DBI-&amp;gt;connect (&amp;quot;DBI:mysql:host=localhost;database=mt&amp;quot;, 
    &amp;quot;username&amp;quot;, &amp;quot;password&amp;quot;, {PrintError =&amp;gt; 0, RaiseError =&amp;gt; 1});
$db-&amp;gt;disconnect ();
exit (0);&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

	&lt;p&gt;and I got the following error:&lt;/p&gt;


	&lt;blockquote&gt;
		&lt;p&gt;File &amp;#8216;C:\mysql\share\charsets\?.conf&amp;#8217; not found (Errcode: 2)&lt;br /&gt;
Character set &amp;#8217;#48&amp;#8217; is not a compiled character set and is not specified in the &amp;#8216;C:\mysql\share\charsets\Index&amp;#8217; file&lt;br /&gt;
&lt;span class="caps"&gt;DBI&lt;/span&gt; connect(&amp;#8216;host=localhost;database=mt&amp;#8217;,&amp;#8217;username&amp;#8217;,...) failed: Client does not support authentication protocol requested by server; consider upgrading MySQL client at mysqltest.cgi line 7&lt;/p&gt;
	&lt;/blockquote&gt;


	&lt;p&gt;Hmm&amp;#8230; Same error message. The easy way would be to give in and use Berkley DB. But not yet. So somewhere there is a hardcoded path to &lt;code&gt;C:\mysql\\share\charsets\?.conf&lt;/code&gt;. I don&amp;#8217;t even have a drive on the C drive (don&amp;#8217;t ask). Looking through the &lt;code&gt;Perl\bin&lt;/code&gt; directory I found the script &lt;code&gt;dbish&lt;/code&gt; (DBI::Shell) where I get the same error when connecting to MySQL. There is also a &lt;code&gt;mt&lt;/code&gt; script, which is kind of weird.&lt;/p&gt;


	&lt;p&gt;Now it seems like I found something. It seems like &lt;span class="caps"&gt;DBD&lt;/span&gt;::mysql tries to install something to &lt;code&gt;c:\mysql\&lt;/code&gt; by default. And since I don&amp;#8217;t have a C drive (don&amp;#8217;t ask) I guess something went wrong. So I guess this is quite unique problem for my computer. Most Windows computers have C drives (like 100% &amp;#8211; 1). Wonder if I can install it manually&amp;#8230;&lt;/p&gt;


	&lt;p&gt;This is taking waaaay too much time, I was just going to install this quickly, work tomorrow. TheRightThing would be to use Berkley DB and go on with my life. But a Perl installation with a faulty MySQL connection, is like&amp;#8230; wrong. Wait a minute. &lt;a href="http://dev.mysql.com/doc/mysql/en/problems-with-character-sets.html"&gt;MySQL Reference Manual :: 5.8.7 Problems With Character Sets&lt;/a&gt; seems to be my friend this late hour. It seems like my charset is not compiled into the binaries. The number #48 in the error message means &lt;code&gt;latin1_general_ci&lt;/code&gt;, which I don&amp;#8217;t have compiled support for. From the manual, enter the &lt;span class="caps"&gt;SQL&lt;/span&gt; query &amp;#8220;&lt;code&gt;show collation;&lt;/code&gt;&amp;#8221; to see which charsets are compiled. I changed the following line in &lt;code&gt;\xampp\mysql\bin\my.cnf&lt;/code&gt; from &amp;#8220;&lt;code&gt;collation-server = latin1_general_ci&lt;/code&gt;&amp;#8221; to &amp;#8220;&lt;code&gt;collation-server = latin1_swedish_ci&lt;/code&gt;&amp;#8221;. Now I don&amp;#8217;t get that error anymore. But I still got the rest of the error (&amp;#8221;... upgrading MySQL client&amp;#8221;). Ok, I tried to run &lt;code&gt;PPM&lt;/code&gt; to upgrade &lt;span class="caps"&gt;DBD&lt;/span&gt;::mysql, but of course &lt;code&gt;PPM&lt;/code&gt; doesn&amp;#8217;t start because of some version of some module is wrong :-(. That&amp;#8217;s all I needed for be able to give in. Bye bye Perl-MySQL.&lt;/p&gt;


	&lt;p&gt;So now it&amp;#8217;s 1:30 a.m. So I head of to bed, and continue tomorrow.&lt;/p&gt;


	&lt;p&gt;Ok, 16 hours later it&amp;#8217;s time to get this thing to work. Let&amp;#8217;s (nah, I haven&amp;#8217;t used &amp;#8220;let&amp;#8217;s&amp;#8221; too many times yet) back up a bit and go for the Berkley DB option. So first I create a the directory &lt;code&gt;\xampp\htdocs\mt\db&lt;/code&gt;, then I comment out the stuff I wrote in &lt;code&gt;mt.cfg&lt;/code&gt; and set the &lt;code&gt;DataSource&lt;/code&gt; to &lt;code&gt;\xampp\htdocs\mt\db&lt;/code&gt;, and remove the &lt;code&gt;mt-db-pass.cgi&lt;/code&gt;. I guess it&amp;#8217;s time to try running &lt;code&gt;mt-load.cgi&lt;/code&gt; again. Fingers crossed&amp;#8230; &amp;#8220;&lt;code&gt;System Initialization Complete&lt;/code&gt;&amp;#8221;. Then I&amp;#8217;m a nice boy and remove &lt;code&gt;mt-load.cgi&lt;/code&gt;. Login at &lt;code&gt;http://localhost/mt/mt.cgi&lt;/code&gt; as user &lt;code&gt;Melody&lt;/code&gt;, password &lt;code&gt;Nelson&lt;/code&gt;. Everything seems to works as it should. &amp;#8220;Create Entry&amp;#8221;. Enter some text. Save. &amp;#8220;Rebuild site&amp;#8221;, get the error &amp;#8220;&lt;code&gt;Use of uninitialized value in substitution iterator at I:/Development/xampp/htdocs/mt/lib/MT/Util.pm line 146.&lt;/code&gt;&amp;#8221; It publishes some .html files, but my blog entry is not there. Hmm&amp;#8230; Changing some settings for the blog. Creating the archives directory. Still the same problem. Oups, I&amp;#8217;m such a noob, as the &lt;span class="caps"&gt;MSN&lt;/span&gt; kids would say. Didn&amp;#8217;t change the status of the entry to &amp;#8220;Publish&amp;#8221;. Now I get a nice blog (but still get the error, but I don&amp;#8217;t care since I&amp;#8217;m just setting this thing up as an exercise).&lt;/p&gt;


	&lt;p&gt;So now you just have to set it up, and start blogging. I guess. But this set-up is probably quite insecure (remeber that I disregarded the permissions).&lt;/p&gt;


	&lt;p&gt;The setup was all in all quite smooth, albeit not a bit fuzzy at times. The main problem for me was, as you can see above, that the Perl-MySQL interface didn&amp;#8217;t work. And that is not MT&amp;#8217;s fault, it&amp;#8217;s what you get when you try to use Windows. I guess that the problem wouldn&amp;#8217;t appear, or be as large, had I installed everything manually instead of using &lt;span class="caps"&gt;XAMPP&lt;/span&gt;. But that would take much more time (disregarding my Perl troubleshooting session). However, I can understand people using other blogging engines.&lt;/p&gt;</content>
  </entry>
</feed>

