By austintnacious on
Can anyone give me some guidance as to what to do about tables left behind by modules I've previously installed and enabled to check them out but then decided not to use.
Generally I go back into the Modules list, disable the module and then delete it's directory from ./sites/all/
Some of these modules, e.g. Devel, Super Nav, seem to have left behind empty DB tables and I'd just like to keep things as clean and clutter free as possible.
- Am I disabling these modules the wrong way?
- Do I just ned to manually drop the tables via phpMyAdmin?
- Will Drupal eventually get round to removing unnecessary DB tables when cron runs?
Thanks
Comments
Firstly, when you disable a
Firstly, when you disable a module you intend to fully get rid of, after disabling it on the Modules page, check the Uninstall tab. Some, but not all, modules include an uninstall process which completely removes every shred of the module's presence from the database. The module's files still need to be in your module's directory for this to work. If you've deleted module files without checking for uninstall options, re-add the files but don't enable the modules. Check the Uninstall tab to see if any show up, and if they do, uninstall them that way. After that you can remove the files as well. Remember that Uninstall completely deletes all of a module's data, and cannot be undone (other than from a backup). Regarding cron, no I don't think it removes any tables.
As for those modules with no Uninstall (which I find frustrating - uninstall option has been around since Drupal 5 came out)... backup your database before trying anything. I'm no expert with this and probably others can chime in with more advice. What I would personally do is check the system table in Drupal (with phpMyAdmin) and delete entries that are clearly related to the removed modules. I'd also completely drop any tables that I know for certain belong to a removed module.
I would suggest setting up a copy of Drupal on your home computer to let you freely test out modules that you're unsure you want/need. Setting up WAMP or MAMP is a piece of cake, and makes life sooo much simpler.
-- David
absolutecross.com
[new guide/lesson in progress: Creating a CCK and Views powered Drupal site - feedback welcome]
Eek! Fatal Error. . .
Thanks, for the help!
That seemed to be exactly the answer, I uploaded Devel and Super Nav via FTP again, went to the Modules/Uninstall page, selected the relevant options clicked "Uninstall" and got the following error. .
"Fatal error: Call to undefined function variable_delete() in /home/content/t/h/e/theblacke/html/sites/all/modules/devel/devel_node_access.install on line 8"Not sure if I introduced the prob by having first deleted the files and now trying to sweep up or if there's a bug in the "Uninstall" script. . .
It halted the script where it was trying to uninstall Devel Node Access.
I re-did the process for Super Nav and have had a lookmin the DB and all the tables I wanted gone are now gone!
Great!
The line entries for Devel and Super Nav have not been removed from the system table though!
Thanks again for the help!
Any idea what might be going on with that error?
About the error, no not
About the error, no not sure. What could "maybe" be the case is if you used a different version of the module than the one you had previously installed (e.g. it could have introduced new changes to the database in a newer version, so when you run that new version's uninstaller, it has an error since its trying to apply to a version of the database table you don't have). If that is the case, I'd recommend getting a copy of the same version of the module you had previously if possible (could be hard if it was a dev version). Alternately, install the new module and actually enable and upgrade it, including running update.php. After that an uninstall should go smoothly.
I'm not positive that Uninstall removes entries from the system table (thought it did, but could be wrong). I found a tip on a Handbook page that said one way to be sure you fully rid your database of every bit of a module's database entries is to open up the module's .install file and have a peek at what tables/fields it is making in the first place when it installs. That should give you a better reference as to what to get rid of.
If a module has left some troublesome cruft in the database, I usually perform a search for the module's name in phpMyAdmin so I get a quick listing of any instance of it so I can click the link and see if it is something I want to delete.
-- David
absolutecross.com
[new guide/lesson in progress: Creating a CCK and Views powered Drupal site - feedback welcome]
change in
"Fatal error: Call to undefined function variable_delete() in /home/content/t/h/e/theblacke/html/sites/all/modules/devel/devel_node_access.install on line 8"change in modules/devel/devel_node_access.install:
function devel_node_access_uninstall() {
variable_delete('devel_node_access_debug_mode');
}
to
function devel_node_access_uninstall() {
variable_del('devel_node_access_debug_mode');
}
Hi This is bhavesh
i just test replay module