Upgrading in Magento has never been an easy task for me. But this time I successfully upgraded the Magento(from 220.127.116.11 to 18.104.22.168) 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/22.214.171.124/126.96.36.199-188.8.131.52.diff.gz zcat 184.108.40.206-220.127.116.11.diff.gz > 18.104.22.168-22.214.171.124.diff patch -p0 -f < 126.96.36.199-188.8.131.52.diff
- 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-184.108.40.206-220.127.116.11.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:
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 🙂