Upgrading Magento from 1.6.0.0 to 1.6.1.0 via diff file

Upgrading in Magento has never been an easy task for me. But this time I successfully upgraded the Magento(from 1.6.0.0 to 1.6.1.0) with minimum no of tries. And I’m going to share the success story ๐Ÿ™‚

First, I tried with the following series of SSH commands but unluckily didn’t work for me:

rm -rf var/cache var/session
rm -rf downloader/pearlib/cache/* downloader/pearlib/download/*
rm -f downloader/pearlib/pear.ini
chmod 550 ./mage
./mage mage-setup .
./mage config-set preferred_state stable
./mage list-installed
./mage list-upgrades
./mage install http://connect20.magentocommerce.com/community Mage_All_Latest --force
php shell/indexer.php reindexall

I went through all the above steps successfully but when I tried to log out and re-login at the backend, version number didn’t change in the admin footer. It means there was no effect of the above code at least for me.

After that I tried the following SSH commands:


rm -rf var/cache/* var/session/*
rm -rf downloader/pearlib/cache/* downloader/pearlib/download/*
rm -f downloader/pearlib/pear.ini
wget http://www.magentocommerce.com/downloads/assets/1.6.1.0/1.6.0.0-1.6.1.0.diff.gz
zcat 1.6.0.0-1.6.1.0.diff.gz > 1.6.0.0-1.6.1.0.diff
patch -p0 -f < 1.6.0.0-1.6.1.0.diff

Notes:

  • Deleting pear.ini is important in case If you have copied the same Magento from another location. Else updates will be installed in your source location instead of the current location.
  • You need to run the above commands from the root of your Magento installation.

After successfully applying the above commands, I refreshed the Magento page but got the following error:

“Error in file: “…/app/code/core/Mage/Sales/sql/sales_setup/upgrade-1.6.0.3-1.6.0.4.php” – SQLSTATE[42S01]: Base table or view already exists: 1050 Table ‘sales_order_aggregated_updated’ already exists”

and this error was easily removed just by renaming the following file:

app/code/core/Mage/Sales/sql/sales_setup/upgrade-1.6.0.3-1.6.0.4.php

Besides, I didn’t get any error and hence upgrading Magento task was successful.
This is the first time I upgraded via applying the .diff file and was so happy that it worked for me ๐Ÿ™‚

Cheers!!

Happy Upgrading!