James Ball

How Do You Do, Fellow Kids?

Reinstalling Existing Magento Modules


Just a quick note, but it seems that despite having the whole thing going on in config files, Magento doesn’t actively do a version diff and reload a new module. If you want the system to reload the module (and re-run any database setup, etc.) take a look in the core_resource table.

+————————-+———+ | code | version | +————————-+———+ | adminnotification_setup | 1.0.0 | | admin_setup | 0.7.1 | | etc … | … | +————————-+———+ mysql>

Just delete your module from this table and then clear Magento’s cache. That should be all it takes to re-load the new module into the system.

Update: What I said above about the versions being meaningless isn’t correct. The mysql4-install-X.X.X.php files will only be run once by the system. However, by changing the version value in your XML config, you’re telling the system which install file it should be looking for. So, for example

//this in your config 0.2.1

//would load this sql install file mysql4-install-0.2.1.php …

When you’re deploying new versions of a module, be sure to change the version of your install script. During development though, it’s still best to just delete the record from your core_resource table.