Magento Re-Index Via Command Line on Server When Index Manager Re-Index is Not Available

Magento Re-Index Via Command Line on Server When Index Manager Re-Index is Not Available
by

If your Magento indexer is timing out or not finishing through the web interface you can still re-index your Magento data via command line on your server (ask your web hosting company for advice on access if you are uncertain).

Magento includes an indexing script that you may utilize easily by running a command. It is in theshellfolder within the root of your Magento install directory. For example if your install is in var/www/vhosts/website.com/ then your shell folder will be at var/www/vhosts/website.com/shell.

The indexer.php file comes with some useful commands:

Check for the status of all Magento indexes

php indexer.php --status

This will output the status of each Magento index.

Re-indexing a single index

Each index has its own Magento index key which you may use to reference it when asking Magento to re-index. To retrieve the keys, you may use the following command:

php indexer.php --info

The results would be similar to:

If you would like to only re-index a single index, use the following command.

php indexer.php --reindex [Index Option Code]

You may also utilize a comma delimited list if you would like to re-index more than one index:

php indexer.php --reindex catalog_product_price,catalog_url,catalog_product_flat

Re-index all Magento Indexes

To loop through each index and re-index it you may run the following command.

php indexer.php --reindexall

Share

Leave a Reply

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