1

I have disabled the 'mollom' module a long time ago but the tables ('mollom' and 'mollom_form') still exit in database and it takes time to repair them when I try to optimize the database. So I am wondering whether it is safe to remove these tables altogether?

6

Disabling a module doesn't mean uninstalling it. To uninstall a module, once you disabled it, you need to go to admin/build/modules/uninstall (Drupal 6), or admin/modules/uninstall (Drupal 7, and Drupal 8), select one of the module listed, and click on the button to uninstall them.

Since Drupal 7, every database table declared with hook_schema() is automatically deleted from Drupal. Modules still need to delete any Drupal variables they define, though. Since Drupal 8, a module can just be uninstalled. You cannot anymore first disable it, and then uninstall; you just go to admin/modules/uninstall and uninstall the modules you need. If the module cannot be uninstalled for any reason, Drupal will show in that page the reason why it cannot be uninstalled.

  • I use D6 and don't see 'mollom' in either admin/build/modules/uninstall or admin/build/modules list. So is it safe to remove its tables from database? – Levox Jan 13 '13 at 21:44
  • In that case, you can delete them, and remove all Drupal variables in the "variable" table. (DELETE FROM {variable} WHERE name LIKE 'mollom\_%') It's not what I would normally do, but for an emergency situation that is what I would do. – kiamlaluno Jan 13 '13 at 23:37
2

If you uninstall the module, it should take care of this for you. By implementing hook_uninstall() modules can define the actions to clean up when the module is not needed anymore, e.g. removing database tables, variables etc. If you only disable the module, these actions will not be performed, so you won't loose the configuration when you enable the module again. You have to uninstall it, when you don't need any of its data.

You can go to admin/modules/uninstall, see the list of the disabled modules and uninstall them.

If you use drush, check out the pm-uninstall command.

  • well, my question was specifically about whether I can remove the database tables. – Levox Jan 13 '13 at 21:23
  • Sorry if it wasn't clear, but my intention was to explain that if you uninstall the module, you don't have to do anything like that, because it happens automatically. – balintk Jan 13 '13 at 22:27
  • Maybe my case is somehow special, but as I mentioned for some reason I still see the tables in database despite the fact that they have been wiped out of the site. Shall I delete them from mysql? – Levox Jan 13 '13 at 23:21

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.