Project

General

Profile

Feature #701

Updated by Daniel Curtis almost 5 years ago

I recently had to fix Magento after a hung update happened. After looking around online I found that Magento can be update directly from the command line. This is a guide for doing so.

* Change into the magento install directory:
<pre>
cd /usr/local/www/sites/magento.example.com
</pre>

*
Set the maintenance.flag file:
<pre>
touch /usr/local/www/sites/magento.example.com/maintenance.flag
</pre>

* Show the list of installed Magento packages:
<pre>
sudo -u www sh /usr/local/www/sites/magento.example.com/mage list-installed
</pre>

* Force the reinstallation of the Mage_All_Latest package:
<pre>
sudo -u www sh /usr/local/www/sites/magento.example.com/mage install http://connect20.magentocommerce.com/community Mage_All_Latest --force
</pre>

* Upgrade any other packages:
<pre>
sudo -u www sh /usr/local/www/sites/magento.example.com/mage upgrade-all --force
</pre>

* Reindex everything:
<pre>
php shell/indexer.php reindexall
</pre>

* Set the correct permissions:
<pre>
chmod -R 644 /usr/local/www/sites/magento.example.com/*
find /usr/local/www/sites/magento.example.com -type d -exec chmod 755 {} \;
chmod 550 /usr/local/www/sites/magento.example.com/mage
</pre>

* Flush all cache and sessions:
<pre>
rm -rf /usr/local/www/sites/magento.example.com/var/{cache,session}/*
</pre>

* Remove the maintenance.flag file:
<pre>
rm /usr/local/www/sites/magento.example.com/maintenance.flag
</pre>

h2. Resources

* https://community.magento.com/t5/Version-Upgrades/CE-1-9-2-update-via-SSH/td-p/10562
* https://firebearstudio.com/blog/upgrade-to-magento-community-1-9-by-ssh.html

Back