Magento Upgrade Woes: How To Fix Everything

So after avoiding the upgrade process for years after experiencing the world’s most intense headache from dealing with Magento, it came upon me to upgrade and rebuild one of my eCommerce websites so that it can do the kind of things that are expected of more modern sites including multiple payment options and a responsive theme for mobile and tablet etc. Unfortunately, this has been the most painful experience ever witnessed by myself and my Mac and even a dedicated Magento-dev that I hired ended up waving their white flag.  I thought I’d jot down some of the fixes that I’ve encountered thus far so that they are saved for posterity. Magento Upgrade Errors The following list will assume that you’ve already followed one of the routes to upgrade your system (there are many) and you should be at the install/upgrade stage via your web browser.  More specifically, you’ve probably already run through this one and encountered one of the dozens of errors that are likely to occur.

Preparation to avoid issues

  • Ensure var/cache, var/session and var/tmp folders exist, with the correct permissions (755) – without this set, Magento will look to store these files all over your server including some very obscure locations that will make debugging an even bigger nightmare.
  • In fact, ensure that all files are now updated with the correct permissions – you can upload this script to your Magento store folder and it will update them for you.
  • Depending on your server, you may encounter ownership issues with the Magento directory and its contents, so ensure that the owner and group (chown/chgrp) are set for the right user.
  • Ensure all instances of your base url within your database are updated with the new site or the caching system of Magento will make it impossible for you to get into your admin and cause all sorts of issues elsewhere on your website:       – Check your core_store_config table for all instances of the domain/url and update.

Database upgrade debugging

  • config.xml – this will swerve integrity key checks if you get stuck on these (during the database upgrade procedure)

    <initStatements>SET NAMES utf8; SET FOREIGN_KEY_CHECKS=0; SET UNIQUE_CHECKS=0;</initstatements>

  • Database errors often occur, especially if the database is large – this is most likely due to the process timing out via the browser.  Try and restart the process again by deleting var/app/local.xml and start by visiting the root address of your Magento installation once more.
  • If database errors persist, delete your database, rebuild it from your backup, delete var/app/local.xml and start the install/upgrade process again by visiting the root address of your Magento installation

After days of painful trial and error and trawling the forums of the web, this has successfully got me upgraded and logged in to my admin.  Now, I just need to try and fix plugin and theme errors…