0

So being relatively new to Drupal development (I have experience programming in other Content Management Systems and writing bespoke functions in PHP/MySQL) I noticed something interesting...

I realised after some development that the custom modules I had installed by uploading to /modules/ should actually have been uploaded in /sites/all/modules/ to avoid being overwritten on a Drupal update.

So I swiftly deleted the modules via FTP, cleared the cache, reuploaded in the correct directory, cleared the cache and continued where I left off.

What I found interesting was that all of the settings I applied to these modules had been remembered.

So my question is, why did this happen? Do modules have access to the DB and store variables there?

And so, if you want to truly remove a module and all its attachments from Drupal, how do you go about this (If it is just a case of storing in DB, then obviously you could delete through phpMyAdmin...but are there any other things to look for that could be left behind)?

Beginning to develop for drupal, it's good to know what is "under the hood" and that's why I ask this question.

Thanks so much for your time, Scott

1

Without disabling/uninstalling the modules, you deleted and placed them in different folder. So here the beauty is Drupal will automatically scan for modules in modules/ and sites/ folder. Thta's why for Drupal the module is still in use.

Disabling a module means, the module is currently not in use, however its data(like DB tables), configuration and everything will kept.

Uninstalling a module means, the module is completely removed. Its data, configuration everything will be cleared.

However the particular module folder will not be deleted.

  • 1
    This is helpful, thank you! I didn't realise there was 'Uninstall' within the Drupal Admin until mentioned in your answer. Drupal is versatile, great news! (Question sounds dumb now haha) – Scott Lawrence Aug 30 '12 at 11:59
0

Depending on the nature of the module, most of the use the DB to store settings/data. Some small modules might not do this though.

Anyway if you want to delete a module, go to "admin/modules/uninstall" to uninstall your module and then remove it from your server. This way you can keep you DB clean.

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.