Upgrade Magento from 1.5.1.0 to 1.6.1.0

Always gotta love that time when you have to face a Magento upgrade. I’m documenting here my experiences and notes during my recent upgrade from Magento version 1.5.1.0 to 1.6.1.0. It must be noted that I use what’s basically the FTP method of upgrading and not via SSH or Magento Connect. I had problems early on with both so have been using this method ever since. I’ve got a BASH script that I use to automate a majority of the upgrade, and that along with a lot of pre-upgrade preparation and post-upgrade QA has been a somewhat stable Magento upgrade method for me.

One thing I’ve noticed during the Magento 1.5.1.0 to 1.6.1.0 upgrade is the addition of a few lines with app/etc/local.xml. With my particular LAMP stack installation, the new lines are:

<![CDATA[SET NAMES utf8]]>
<![CDATA[mysql4]]>
<![CDATA[pdo_mysql]]>

These new lines go before the old XML elements:

<![CDATA[your_magento_database_name]]>
1

One thing you have to do before visiting your site and instantiating the upgrade is to reindex the tables:

php shell/indexer.php reindexall

During this procedure the program threw two errors:

Product Prices index process unknown error:
exception 'PDOException' with message 'SQLSTATE[42S22]: Column not found: 1054 Unknown column 'website_date' in 'field list'' in /home/ereckers/public_html/mimiboutique.com/public/lib/Zend/Db/Statement/Pdo.php:228
Stack trace:
-- the messages

Next exception 'Zend_Db_Statement_Exception' with message 'SQLSTATE[42S22]: Column not found: 1054 Unknown column 'website_date' in 'field list'' in /home/ereckers/public_html/mimiboutique.com/public/lib/Zend/Db/Statement/Pdo.php:234
Stack trace:
-- the messages

I tried the solution found here:

However, instead of dropping the table and rebuilding it with the schema mentioned above, I simply updated the column name:

ALTER TABLE  `catalog_product_index_website` CHANGE  `date`  `website_date` DATE NULL DEFAULT NULL

This works because you keep the data and the table schema found in the aforementioned post is actually wrong.

So basically, before you run the re-indexer, you need to run the ALTER TABLE on your newly copied database.

After updating the table I re-ran the re-indexer:

php shell/indexer.php reindexall

A successful run will return:

Product Attributes index was rebuilt successfully
Product Prices index was rebuilt successfully
Catalog URL Rewrites index was rebuilt successfully
Product Flat Data index was rebuilt successfully
Category Flat Data index was rebuilt successfully
Category Products index was rebuilt successfully
Catalog Search Index index was rebuilt successfully
Tag Aggregation Data index was rebuilt successfully
Stock Status index was rebuilt successfully

After that, visit your installation.

Here’s a couple resources from the Magento Community for this particular upgrade path:

These are notes from a basic FTP/Tarball upgrade of Magento version 1.5.1.0 to 1.6.1.0 of which a majority of the upgrade is handled with a BASH script which I may be able to get posted to a public GIT repo soon.

Post written by Ed Reckers

Founder and lead web development consultant at Red Bridge Internet : San Francisco WordPress Developers and Consultants.

Leave a Reply