Is there an easy way to detect tables that are no longer used by my Drupal installation? I find it annoying that tables from previously used modules remain. I'll simply drop them using phpMyAdmin if not, but its a bit of a pain, and involves backing it up for obvious reasons! ;)


I think Schema will tell you that. If a module leaves tables after uninstall, that's a bug, and you should open an issue.

  • 2
    Schema's advice should be taken with a grain of salt. It can have both false positive and false negative results. For example, it may mark all field data as unused tables. It is the right tool for this job though.
    – rfay
    Sep 21 '11 at 21:55

After disabling and before removing the module run drush pm-uninstall 'modulename' in the terminal.(More info on drush)
Or through the website go to /admin/modules/uninstall.
The name of the module will still be found in the 'system' table, this can be deleted manually.

  • 1
    Why the name of the module will still be found in system table? Isn't drush pm-uninstall - uninstalling everything? I have noticed myself this thing either, after every use of pm-uninstall, the module name remains in the system table. What reason to use pm-uninstall then? Oct 5 '13 at 9:08
  • Calling uninstall deletes all module related tables from the DB. It also calls hook_uninstall which can delete module specific settings. The module still exists in the system directory because the module is available in the modules directory. However, its status is set to disabled.
    – JurgenR
    Oct 7 '13 at 12:24
  • 1
    So if i delete it from /sites/all/modules it's going to dissapear in the system table you say? Oct 7 '13 at 16:13
  • I'm not completely sure but would say yes. If the module is uninstalled properly and the module is removed from sites/all/modules the entry in the system table can be safely deleted. If not automatically, if cvan be done manually.
    – JurgenR
    Oct 10 '13 at 8:40
  • Well, thanks for your explanations i'm going to check this out. Oct 10 '13 at 9:46

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.