How to upgrade Magento 1 using SSH CLI

This is an easy and quick upgrade guide for updating Magento 1.7, 1.8 and 1.9 to Magento 1.9.x. While the upgrade is largely risk-free, please note we accept no responsibility for any negative, damaging or otherwise impactful repercussions from the instructions in this guide. Follow at your own risk and excise caution. If you are unsure, seek help from a Magento Certified developer.

1. Create a full website backup! Make a copy of all your Magento installation files, and database, in case something goes wrong.
2. Login to the SSH using the user credentails of your Magento account
3. Follow the below commands:

cd ~/public_html/
touch maintenance.flag
chmod +x pear
chmod +x mage
chmod 750 mage
./pear mage-setup .
./pear upgrade -f magento-core/Mage_All_Latest-stable
./mage config-set preferred_state stable
./mage sync
./mage upgrade-all --force
php shell/indexer.php reindexall
rm -rf downloader/.cache/ var/cache/
./n98-magerun.phar cache:flush
rm -rf maintenance.flag

NBĀ  if you experience any problems or errors running "./mage upgrade-all --force", you may have luck with this command instead:
./mage install Mage_All_Latest --force
  • magento, magento 1, cli, php, upgrade, stable, maintenance.flag, backup, backups, ssh, updater, update, cache, magento 1.7, magento 1.8, magento 1.9, magento stable
  • 2 Users Found This Useful
Was this answer helpful?

Related Articles

Exception: Notice: Use of undefined constant ICONV_IMPL

Exception: Notice: Use of undefined constant ICONV_IMPLAre you experiencing this error when...

How to re-index from PHP command line using SSH

As your Magento store grows in size with more products, orders and customers, you may experience...

Efficient Magento 1 cron on CloudLinux systems

It's no secret that CloudLinux, with its CageFS and PHP selectors, cause problems running the...

How to Install RabbitMQ Server on CentOS 7

RabbitMQ is an open-source message broker, which can be used to greatly enhance the speed of...