This has happened to me a couple of times while testing modules:

You disable the module, erase the files and decide to drop the tables created by the module and empty the cache in order to do a clean reinstall of the module.

Only that this time, the module .install file is not executed.
Usually this is not much problem, since you can go in and copy/paste the MySQL code yourself.

But it's inconvenient, and in some modules the .install code is not that clear with conditional statements that check for upgrades, etc.

Is there a table that keeps track of installed modules and prevents the .install file from being ran?
I did find a couple of module related entries on the system table, another one on the sequence table and some in the variable table.

In this case, I was trying to debug some errors with the buddylist module in 4.7. I uninstalled it, dropped the database tables, erased the module, emptied the cache and remove all entries I found from the system, sequence and variable tables.

But when I try to reinstall the module, the .install file code is not executed.

Where should I look for to reset this flag?

Thanks.

Comments

biohabit’s picture

I would really like to see an answer to this question as well.

Rewted’s picture

Me too. Been having issues with TinyMCE for 4.7, evenyone else seem to have it working fine... my .install doesn't run.

coreb’s picture

Yes, same here. (sorry for trolling, but I want to track when the real answer does come)

hitka’s picture

Drupal stores some info about themes/modules/theme engines in a table named system. So basically what you need to do in order to make Drupal forget your module is this:
DELETE FROM system WHERE name = 'name_of_your_module' AND type = 'module'

Rewted’s picture

So if the name of the module in question isn't in the system table, it's safe to assume the .install isn't even inserting to the DB, correct?

druvision’s picture

To delete them all, I've run the following query (Drupal 5):

delete  from system where filename like '%ecommerce%' and type ='module';

Amnon
-
Drupal Focused Search Engine | Drupal Israel
Personal: Hitech Dolphin: Regain Simple Joy :)

rgs’s picture

don't forget this one:

, Fedex shipping API for E-Commerce.&quot

joseabrahamg’s picture

Thank you very much. It worked for me.

Carlos Miranda Levy’s picture

My bad, I went ahead and posted a question without properly researching the issue.
The answer is here:
http://drupal.org/node/51220

Basically, yes, you have to go to the system table in your MySQL database and remove the record for the module you want to reinstall. For some reason I wasn't finding that record in my case (must likely I was doing a search for "like buddy" and not "contains buddy". When I did search againg for buddylist, I found it, removed it and reinstalling did execute the .install file this time.

I apologize. Although, it seems this will help others get an answer to the same question.

Regards.

------
Con paciencia y calma,
sube un burro a una palma

sepeck’s picture

Might be good to summarize and add an item with a link to the Troubleshooting FAQ
http://drupal.org/node/199

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide

whereisian’s picture

A reinstall module funtion is available in the devel module block.

ardee-1’s picture

Thank you, whereisian, for that info! It is very helpful!!

IntoTheWoods’s picture

you can also add an uninstall hook with at least one command in your mymodule.install file, such as:

function mymodule_uninstall() {
  drupal_set_message(t('My module is now uninstalled.'));
}

Disable your module and then go to the uninstall tab at admin/build/modules/uninstall and your module should now show up there.

mchar’s picture

See related post here