Living With Magento: The Upgrade
January 1, 2012
I just finished preforming a Magento Upgrade, from 1.5 to 1.6 stable. Yes, I know, a little late, but I knew this was going to be a pain, so I have been procrastinating and wanted to wait until I had some free time.
Like most things Magento, it took some fighting, a bit of cussing, and a large amount of debugging, but I got there in the end.
My main advice is, of course, Backup ALL your files and database, as well as do the update on a test server! This is good advice for pretty much any sort of upgrade, but ESPECIALLY with Magento.
TLDR: If you want the abbreviated steps I used to fix the Magento database upgrade errors, see here. I wish I had kept a record of the actual errors I fixed, sorry!
The Upgrade Process
I started with the Wiki posted here: https://www.magentocommerce.com/wiki/1_-_installation_and_configuration/magento_1.5_to_1.6_upgrade
I found a few other sites, but the process they suggested seemed similar.
The initial upgrade went fine and the site was still viewable and browseable, until I started clicking around a bit. I soon started running into issues, which I think were related to a bunch of exceptions during the reindexing step.
For example, clicking on “Add to Compare” broke the site, throwing an error. Attempting to reindex or refresh the caches also broke the website, throwing an error and blocking Magento from loading.
I reverted once, just to make sure I had done the steps correctly, but it broke again. So, it was time to dig in and do some Magento debugging. This involved enabling errors by temporarily copying ‘errors/local.xml.sample’ to ‘errors/local.xml’ , fixing the error, then rinse/repeat approximately 10 times.
By viewing the php error messages, it soon became clear that most of the problems were occurring during the Mysql upgrade scripts. One of the issues, the website_date problem, was discussed in the Wiki, but most were not.
I got lucky with a few and found them, or at least something similar, via Google on the Magento Forums. For most part, however, I needed to rely on the reported error to fix it. This involved checking the mysql upgrade file reported in the error and either editing it or changing the mysql tables accordingly.
Some issues, I think, were related to the update starting, failing, then trying to run again. When it ran again, the parts that worked initially, caused it to fail the second time. IE, the website_date issue.
It took a number of iterations, however I finally got it up and running again, rolling it out to the live website. I have tested most stuff, but am prepared to do some additional troubleshooting once the staff of the store get in tomorrow.
To describe the Magento Upgrade process briefly, I would say it sucks. From fixing my errors, it is obvious that it does not go smoothly for a lot of other people too.
Most of my issues were centered around the Mysql upgrade script(s,) so to fix it, I had to alter, drop tables, and generally muck around in Mysql, as well as manually fix/modify the php upgrade scripts.
From my experience with Magento, which includes Theming, editing the codebase to address specific issues, and creating Magento plugins, I knew this was going to be a headache and it did not let me down! There are a lot of things I like about Magento, but it is a beast in terms of resources and it can be difficult trying to find support, so I usually end up having to figure stuff out on my own.
Update: Finding and Fixing Magento Upgrade Issues:
Since I can see some people are finding this post through search and have similar Magento upgrade problems, I made a TLDR version of the steps I used to fix.
This is how I fixed the Mysql Errors, however keep in mind, you will need a background for MYSQL/PHP and most likely will run into different errors too.
1. Begin Upgrade Process
2. Review PHP MYSQL Error when it breaks. One way is to copy ‘errors/local.xml.sample’ to ‘errors/local.xml,’ although this makes it public to all.
3. Search for others who had specific error (I wish I had kept a record of the 10 or so I had, Sorry!)
4. If you don’t find a solution, review the PHP File Referenced and the actual MYSQL Error
5. Update the PHP File to fix the error, by commenting out the php section, if the update already ran, or fixing the mysql statement. You may also need to alter the mysql magento database*
6. Go back to #1 until it completes.
* Don’t edit any PHP or alter the mysql tables without understanding why you are doing it. If you are unsure what the PHP code or mysql statement is doing, DO NOT attempt this on your own, seek professional assistance, because you could break something!