0

I need a fast way to resave all 75.000 products in my Magento 1.9 store. Currently I use the following code, but that is not very fast.

Is there a better and faster way to resave all products?

CODE:

<?php
set_time_limit(0);

// require magento core
require_once 'app/Mage.php';

// execute on admin store
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);

$products = Mage::getModel('catalog/product')->getCollection();
foreach($products as $product) {
    echo $product->getData('sku') . '<br/>';
    // save the product
    $product->save();
}
?>
  • >Try to run this script via ssh instead of browser. If you use ssh this will avoid connection timed out error also. – Chander Shekhar Nov 16 '17 at 13:09
  • @ChanderShekhar Thanks! I already run this script using ssh. But is still quite slow. Is there a faster way to achieve this? – JGeer Nov 16 '17 at 13:18
  • 1
    Can you tell me why you need to resave all the product? – Dhiren Vasoya Nov 16 '17 at 13:42
  • Can you add some details why you want this? (Tried arround and found no really faster way) – sv3n Mar 7 '18 at 22:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.