UPDATED: How to re-run extension SQL "setup" files

Submitted by deeperdata - 1 year ago

If you have ever tried your hand at extension development and found that your install scripts didn't complete or if you had a mishap occur while trying to install a 3rd party extension - this trick will allow you to rerun your database setup scripts. I originally listed the manual way of checking but have since added n98-magerun methods. e.g. mysql4-install-0.1.0.php mysql4-install-0.1.1.php mysql4-install-0.1.2.php mysql4-upgrade-0.1.0-0.1.1.php mysql4-upgrade-0.1.1-0.1.2.php

// Step 1. Remove the record from the core_resource table where code matches your extension name.
// Step 2. Clear the cache
// Step 3. Refresh any page and Magento will trigger the setup/install scripts
// for any extension not containing an entry in core_resource.

If you're using MageRun you do do the following:

"./n98-magerun.phar sys:setup:incremental" will list unran setup scripts and automatically ask if you would like to run them.
"./n98-magenrun.phar sys:setup:run" will just run them.
Learn PHP
comments powered by Disqus
Proudly hosted on Digital Ocean