Magento refresh index ssh command

Magento can use allot of resources re-indexing, and you may find that doing re-indexing through the admin panel often fails and/or times out. So running the re-indexing using shell commands is very beneficial, not only does it appear to work faster, it will also run for as long as it needs without any interruptions. It’s very easy to run Magento re-index using a command shell, just follow these steps – you could even set this up as a cron if you know what you are doing!  

Full Magento re-index using SSH

To perform a full re-index just follow these steps:

  1. Open a SSH shell to your server.
  2. Change the directory to your Magento root folder, ie.
    cd /home/mysite/public_html/ 
  3. You will need to CD into the /shell folder, ie.
    cd shell/
  4. Run the following command to re-index magento through SSH:
    php -f indexer.php reindexall


This will perform re-indexing on all 8 of Magento’s indexers:

catalog_product_attribute Product Attributes 
catalog_product_price Product Prices 
catalog_url Catalog Url Rewrites 
catalog_product_flat Product Flat Data 
catalog_category_flat Category Flat Data 
catalog_category_product Category Products 
catalogsearch_fulltext Catalog Search Index 
cataloginventory_stock Stock status


Individual Magento re-index in SSH

Following the steps above until step 4 and using any of the commands below to run each individual re-indexer:

php indexer.php --reindex catalog_product_attribute
php indexer.php --reindex catalog_product_price
php indexer.php --reindex catalog_url
php indexer.php --reindex catalog_product_flat
php indexer.php --reindex catalog_category_flat
php indexer.php --reindex catalog_category_product
php indexer.php --reindex catalogsearch_fulltext
php indexer.php --reindex cataloginventory_stock
php indexer.php --reindex tag_summary


Author: Dean Williams

Professional PHP Web Developer with expertise in OpenCart Web Development, WordPress Web Development, Bespoke Systems - also a seasoned Linux Server Administrator.

Leave a Reply

Your email address will not be published. Required fields are marked *