Upgrading Magento Via SSH
- Applies To: All Services
- Difficulty: Easy
- Time Needed: 10 minutes
- Tools Needed: SSH
- Reading Time: 0:03 min
The following commands work for any hosting environment, but it’s primarily for users that are in an environment with no suEXEC, like one where PHP is running as an Apache module.
In this kind of environment, all web-based processes are owned by user nobody, unlike an environment with suEXEC, where these are owned by the user.
Once you’ve accessed your site via SSH, change in to the directory where Magento is installed. Run the following commands to upgrade Magento:
./pear upgrade-all rm -rf downloader/pearlib/cache/* downloader/pearlib/download/*
For Magento 1.5.x or later, you will use the following commands:
./mage upgrade-all rm -rf downloader/pearlib/cache/* downloader/pearlib/download/*
If you receive an error, that means the PEAR registry has not been initialized. You need to run the following commands:
./pear mage-setup . ./pear install magento-core/Mage_All_Latest rm -rf downloader/pearlib/cache/* downloader/pearlib/download/*
For Magento 1.5.x or later, please use the following:
./mage mage-setup . ./mage sync ./mage install http://connect20.magentocommerce.com/community Mage_All_Latest rm -rf downloader/pearlib/cache/* downloader/pearlib/download/*
This is only required once, after it’s initialized you don’t need to do this again and can use the first command listed in this article.
You also might need to clear your cache directory out after an upgrade:
rm -rf var/cache/*
Please ensure you have basic development knowledge and have taken a full back up of your website prior to the upgrade
We recommend getting your developer to assist you with the any website upgrades