Bulk product updating process runs a quite long time, because of product model updating ($product->save()
) fires a lot of observers. If you can add some coding to the script try add this logic given below.
1.Switch index process to "Manual indexing" before updating runs, after updating I revert to auto indexing:
//swich indexer to "manual update" mode
$pCollection = Mage::getSingleton('index/indexer')->getProcessesCollection();
foreach ($pCollection as $process) {
$process->setMode(Mage_Index_Model_Process::MODE_MANUAL)->save();
}
//Your script starts.
//Here is your codes
//which updates collection of products within the loop.
//foreach($collection as $product){
// ...
// $product->save();
// ...
//}
//
//End your custom update script.
//swich indexer to "update on save" mode
$pCollection = Mage::getSingleton('index/indexer')->getProcessesCollection();
foreach ($pCollection as $process) {
$process->setMode(Mage_Index_Model_Process::MODE_REAL_TIME)->save();
}
After sucessfully updating all products you should re-index all indexers via Magento admin panel.
2. If you want update some attributes of products (but not inventory attributes), use this code also:
Mage::getSingleton('catalog/product_action')
->updateAttributes($arrayOfProductIds, array('some_attribute' =>'some_value'), Mage::app()->getStore()->getId());
Two snippets given above really help your script to run fast.