<?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>That Matt &#187; Web Apps</title>
	<atom:link href="http://that-matt.com/category/web-apps/feed/" rel="self" type="application/rss+xml" />
	<link>http://that-matt.com</link>
	<description>That one, not this one!</description>
	<lastBuildDate>Tue, 28 Feb 2012 22:41:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Upgrading to Magento 1.4.1.1 from 1.4.0</title>
		<link>http://that-matt.com/2010/09/upgrading-to-magento-1-4-1-1-from-1-4-0/</link>
		<comments>http://that-matt.com/2010/09/upgrading-to-magento-1-4-1-1-from-1-4-0/#comments</comments>
		<pubDate>Sun, 26 Sep 2010 17:18:40 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Web Apps]]></category>
		<category><![CDATA[ecommerce]]></category>
		<category><![CDATA[magento]]></category>
		<category><![CDATA[upgrade]]></category>

		<guid isPermaLink="false">http://that-matt.com/?p=179</guid>
		<description><![CDATA[I recently had to upgrade an installation of magento 1.4.0 to version 1.4.1.1.  As anybody who&#8217;s ever tried to upgrade magento will tell you, the upgrade path is usually less than ideal (For some people the only way to upgrade &#8230; <a href="http://that-matt.com/2010/09/upgrading-to-magento-1-4-1-1-from-1-4-0/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I recently had to upgrade an installation of magento 1.4.0 to version 1.4.1.1.  As anybody who&#8217;s ever tried to upgrade magento will tell you, the upgrade path is usually less than ideal (For some people the only way to upgrade from 1.3 to 1.4 was to manually export / import their data into a new installation)</p>
<p>As strange as it seems, it appears the most reliable way to upgrade an installation is to install the new version over <span style="text-decoration: underline;"><strong>a copy</strong></span> of the old version&#8217;s database. (Note, you should never attempt to install over the production database lest things go wrong!)</p>
<p>Here&#8217;s a quick guide on how I managed to get the installation in question upgraded, hopefully it&#8217;ll work for you too! <img src='http://that-matt.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> <span id="more-179"></span></p>
<h2>Get rid of any coupon codes</h2>
<p>If you try and upgrade magento without doing this then the installer will fail with a &#8220;foreign key constraint fails&#8221; error.  You should make a note of your codes so that you can re-add them to your upgraded store.</p>
<h2>Copy the database</h2>
<p>In my experience the fastest way to get a copy of the database is to use the <em>mysqldump</em> command on the server over ssh.</p>
<pre class="brush:bash">mysqldump -u{username} -p {database_name} &gt; production_backup.sql</pre>
<p>Obviously you should replace {username} and {database_name} with their appropriate values.  You&#8217;ll also be asked for the db user&#8217;s password when the program connects to the mysql server.</p>
<p>If you don&#8217;t have shell access on your server then you can always use another tool such as phpmyadmin, but it&#8217;s slower and less secure.</p>
<h2>Download a fresh copy of Magento 1.4.1.1</h2>
<p>We now need to download a fresh copy of magento and put it in a separate place from the production site (e.g. testing.{yoursite}.com) where we can run the upgrade safely.  See the magento wiki for more info on <a href="http://www.magentocommerce.com/wiki/groups/227/installing_magento_via_shell_ssh">downloading magento from a shell</a>.</p>
<p>From now on I&#8217;ll refer to the directory you extracted the code to as the &#8220;upgrade test&#8221; directory.</p>
<p>You should also create a separate database to run the upgrade on.</p>
<h2>Modify the Magento Installer</h2>
<p>One of the big issues with the installer supplied with magento is that they assume all of the tables it tries to create don&#8217;t exist (which isn&#8217;t the case).  To get around this we run a quick find &amp; replace in the root of the new &#8220;upgrade test&#8221; magento installation:</p>
<pre class="brush:bash">find . \
    -type f -name "*.php" \
    -exec sed -r -i  \
    "s/CREATE TABLE \`?\{([^}]+)\}\`? \(/CREATE TABLE IF NOT EXISTS \`\{\1\}\` \(/g" \
    {} \;</pre>
<p>If you&#8217;re not familiar with sed, this command basically looks in php files for the string &#8220;CREATE TABLE {table_name} (&#8221; and replaces it with &#8220;CREATE TABLE IF NOT EXISTS {table_name} (&#8220;.  You should execute it in your upgrade test directory, not in the production site dir.</p>
<h2>Run the installer</h2>
<p>If you browse to your testing installation (i.e. http://testing.yoursite.com) you should be redirected to the magento web installer, which should allow you to &#8220;install&#8221; magento.  <strong>When it asks you for a security / encryption key make sure you give the same key that your production install is using.</strong></p>
<p>If you can&#8217;t remember what key your production install is using then have a look in app/etc/local.xml in your production installation.  You should see something like:</p>
<pre class="brush:xml">            <![CDATA[fihfw9393rjW3493jwfwfj93jfww]]&gt; </pre>
<p>In this example the key is fihfw9393rjW3493jwfwfj93jfww.</p>
<h2>Chillax!</h2>
<p>At this point you should hopefully have a fully functioning version of 1.4.1, sans custom theme / installed modules / product images.  To migrate the product images remove the media dir and copy the one from your production installation over.</p>
<p>If something broke during the upgrade then you&#8217;ll need to find the cause of the problem and then re-attempt the upgrade afresh.</p>
]]></content:encoded>
			<wfw:commentRss>http://that-matt.com/2010/09/upgrading-to-magento-1-4-1-1-from-1-4-0/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Config cache problems with Magento</title>
		<link>http://that-matt.com/2010/08/config-cache-problems-with-magento/</link>
		<comments>http://that-matt.com/2010/08/config-cache-problems-with-magento/#comments</comments>
		<pubDate>Sun, 01 Aug 2010 19:18:00 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Web Apps]]></category>
		<category><![CDATA[Web Servers]]></category>
		<category><![CDATA[magento]]></category>

		<guid isPermaLink="false">http://that-matt.com/?p=158</guid>
		<description><![CDATA[After having numerous problems upgrading a Magento site 1.4.1.1 on a test server I decided to try and get it working locally before applying the fix(es) to the live server. This is a fairly simple process and there&#8217;s lots of &#8230; <a href="http://that-matt.com/2010/08/config-cache-problems-with-magento/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>After having numerous problems upgrading a Magento site 1.4.1.1 on a test server I decided to try and get it working locally before applying the fix(es) to the live server.</p>
<p>This is a fairly simple process and there&#8217;s <a href="http://blog.chandanweb.com/magento/how-to-change-base-url-in-magento">lots</a> of <a href="http://www.magentocommerce.com/wiki/groups/227/moving_magento_to_another_server">information</a> on how to do it.  The key steps in the process are emptying magento&#8217;s cache directory and updating the base urls in the core_config_data table so that magento will generate correct urls.</p>
<p><span id="more-158"></span></p>
<p>When I setup my copy of the site locally I changed local.xml &amp; deleted the cache before modifying the db, just to make sure that magento was connecting ok.  Once that was done I went off to delete the new cache files from siteroot/var/cache.  Only, there weren&#8217;t any cache files.  I took no note of it figuring magento had just decided not to cache the files and so proceeded to load the site, only for it to redirect me to the live site.</p>
<p>I spent the next few hours trying in vain to work out where magento was getting the idea that it should redirect to the main site.  After wiping the db / files and re-extracting them several times I noticed that it was still redirecting even if the database was empty and the cache dir (var/cache) didn&#8217;t exist.  Obviously this is one helluva wtf, especially as there weren&#8217;t any references to the live site&#8217;s address in the files.  The opinion on IRC was that somehow my local site was talking to the production site&#8217;s db and was using it&#8217;s database instead of my local one, however this couldn&#8217;t be the case as magento started complaining if I dropped the local database entirely.</p>
<p>In a last ditch attempt I tried grepping for the site&#8217;s address across the entire filesystem (using grep -R &#8220;sitedomain.com&#8221; / ) and came across a load of files in /tmp/magento.  After deleting the directory magento started working perfectly again, though it continued to store cache files in /tmp/magento rather than var/cache/ for some reason.</p>
]]></content:encoded>
			<wfw:commentRss>http://that-matt.com/2010/08/config-cache-problems-with-magento/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Can&#8217;t Install Drupal? Correct DB info yet no error?</title>
		<link>http://that-matt.com/2009/07/cant-install-drupal-correct-db-info-yet-no-error/</link>
		<comments>http://that-matt.com/2009/07/cant-install-drupal-correct-db-info-yet-no-error/#comments</comments>
		<pubDate>Wed, 15 Jul 2009 21:33:20 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Web Apps]]></category>
		<category><![CDATA[Bugs]]></category>
		<category><![CDATA[Drupal]]></category>

		<guid isPermaLink="false">http://sigswitch.com/2009/07/cant-install-drupal-correct-db-info-yet-no-error/</guid>
		<description><![CDATA[The solution is to make sure that: a) You have a copy of default.settings.php in the sites directory to which you are installing drupal and b) Make sure the default directory still exists with its own copy of default.settings.php / &#8230; <a href="http://that-matt.com/2009/07/cant-install-drupal-correct-db-info-yet-no-error/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>The solution is to make sure that:</p>
<p><span id="more-90"></span></p>
<p>a) You have a copy of default.settings.php in the sites directory to which you are installing drupal and<br />
b) Make sure the default directory still exists with its own copy of default.settings.php / settings.php</p>
<p>It&#8217;s a very weird bug</p>
]]></content:encoded>
			<wfw:commentRss>http://that-matt.com/2009/07/cant-install-drupal-correct-db-info-yet-no-error/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

