Upgrading Magento from to via diff file

Upgrading in Magento has never been an easy task for me. But this time I successfully upgraded the Magento(from to 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/
zcat >
patch -p0 -f <


  • 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-” – 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:


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 ๐Ÿ™‚


Happy Upgrading!