I had to manually reindex a magento website and to avoid timeout I use the following shell command from the magento installation directory:
php shell/indexer.php reindexall
That does what is easy to understand, reindex all the available indexes.
The problem was that the website’s database was too big to be reindexed correctly by this one command, so I had to reindex each index separately.
To do so, here a list of quick commands:
This will output the list of the indexes’ name
php shell/indexer.php info
This will output the status of each index
php shell/indexer.php --status
And finally this, will allow to reindex a specific index
php shell/indexer.php --reindex name_of_the_index_from_the_info_command
This procedure has made possible to reindex the site without errors or huge wait times.