Right now I,m facing problem with high resource usage of my Drupal 6 website, I can't find the solution to solve the issue, when I checked the system table, uninstalled modules still in system table, Is this normal or not uninstalled properly.
-
Modules deleted but not disabled can increase performance of Drupal site. For D7 we can use drupal.org/project/clean_missing_modules .– AgACommented Jul 5, 2013 at 5:54
-
@AgA I uninstalled in proper way, but i don't know why it showing in system table– BalaCommented Jul 5, 2013 at 6:01
-
which modules and in which table?– AgACommented Jul 5, 2013 at 6:04
-
@AgA not sure what you are asking, but i disabled it and then uninstalled the module. In system table i can see the uninstalled modules with status "0".– BalaCommented Jul 5, 2013 at 6:21
2 Answers
There is apparently infinite loop of "marked as dulpicate" bug reports related to this on Drupal.org. Starts form me with Deleted modules are not removed from system table. Long story short, yes, it happens, and it seems it can be both due to Drupal bug or bug in a modules in question.
There used to be a module to clean this up, but it wasn't even finished before this functionality ended up in Drupal 7 core. If you feel like risking, you can download sources using Repository viewer.
On the other hand, most queries filter by status field, and there should be already a BTREE index on it, so leftovers should not hurt you much anyway. If you want to cleanup manually, be sure nothing depends on modules you are about to purge and their files are already deleted, make backups, put site in maintenance mode, logout everyone (including you) and be prepared to restore {system}
table (or whole database) from backup if needed.
-
I don't want to take any risk in my production site, @Molot can you please tell me, Safely is it possible to remove manually from system table. (Note : At the time i need to remove only one module.)– BalaCommented Jul 5, 2013 at 7:26
-
1@Bala it has never hurt me to do it, if I was sure nothing depends on it any more and files are really not there. On the other hand, most queries filter by
status
field, and there should be already a BTREE index on it, so most of the time it should not hurt you anyway. If you want to cleanup, make backups, put site in maintenance mode and be prepared to rollback that table.– MołotCommented Jul 5, 2013 at 7:33 -
Sorry @Molot rollback in the sense, will i delete the rows related to a module ?– BalaCommented Jul 5, 2013 at 7:57
-
Drupal adds an entry in system table for each module present in the filesystem, even if it has never been enabled. This is the same for Drupal 6 and 7. In Drupal 8 the system table has been removed.
So, if you want to get rid of entries in system table for uninstalled modules, remove them from the filesystem once they're uninstalled.
See _system_rebuild_module_data() for details in Drupal7. In drupal 6 this function was called module_rebuild_cache().
-
-
@Bala nope, it is not. That's the functionality that ended in 7 core I was talking about in my answer. There are somehow similar pieces, you can look at the bug reports linked and search for them if you want, but for many people it wasn't really workable back then in 6.– MołotCommented Jul 5, 2013 at 8:20
-
Indeed it is the same thing for Drupal 6 and 7. Updated my answer. Commented Jul 5, 2013 at 8:32
-
Thanks for this, I had no idea that a module was added to the system table even if it hasn't been enabled yet. Commented Jun 2, 2014 at 19:14