Truly Uninstalling Modules 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
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.