Script to execute upgrade actions without flushing the cache in Magento

When having many different servers I have faced more than once issues related to module installation/upgrades. Here you have a quick script that upgrades all modules from terminal:

<?php
require_once "../app/Mage.php";
Mage::app('admin');

$begin = microtime(true);
Mage::log("Upgrade Begin-".$begin);

Mage_Core_Model_Resource_Setup::applyAllUpdates();
Mage_Core_Model_Resource_Setup::applyAllDataUpdates();

$end = microtime(true);
Mage::log("Upgrade End-".$end);
Mage::log("Duree : ".($end - $begin));

Leave a Reply

Your email address will not be published.