Upgrading Magento from 1.6.0.0 to 1.6.1.0 via diff file

November 10, 2011  |  4 Comments  |  by Raj (MagePsycho)  |  Latest, Linux, Magento

Uprading 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 logout and re-login at the backend, version number didn’t change in the admin footer. It means there was no effect of 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 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 successfull.
This is the first time i upgraded via applying the .diff file and was so happy that it worked for me :)

Cheers!!

Happy Upgrading!

Posted in Latest, Linux, Magento and tagged , . Bookmark the permalink.

About Raj (MagePsycho)

Raj, the guy behind MagePsycho is a Zend PHP5 Certified Engineer, Magento Certified Developer, Magento Moderator / Freelancer with specialization in web applications (CMS, E-Commerce, ERP etc.). Catch him on: Twitter: @magepsycho Skype: magentopycho
  • http://www.coelsl.es syscoel

    Unzipping command didn’t work for me and i downloaded that .gz file
    It is not a tar.gz file but .gz what you download one way of uncompessing the file could be:
    zcat 1.6.0.0-1.6.1.0.diff.gz > 1.6.0.0-1.6.1.0.diff
    Thanks for this howto it worked flawlessly, I have tried before upgrading from Magento Connect and it killed my installation.

    • http://www.magepsycho.com MagePsycho

      Thanks for the SSH Command.
      Will update in my post.

  • http://brianvaughan.metroblog.com/ Magento Development Company

    Thanks for post It’s great and helpful information.

  • Marklee

    When you say

    “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”

    What exactly do you mean. I renamed the file and now I get

    Error in file: “/home/cbros11/public_html/app/code/core/Mage/SalesRule/sql/salesrule_setup/upgrade-1.6.0.0-1.6.0.1.php” – SQLSTATE[42S01]: Base table or view already exists: 1050 Table ‘coupon_aggregated_updated’ already exists

    Please help!