Drupal Installation modules leftovers cleanup I have some questions that more experienced Drupalers might know.

When you have been developing a Drupal site, installing, uninstalling and testing various modules for different set of functionalities, when the launch day comes how do you clean up leftovers of the modules? To be more specific.


How do you remove folders that are not needed anymore from the sites/all/modules folder?
How do you remove leftover database tables?
Is there a contrib module that can actually do that? Cleanup a Drupal Installation?


Thanks in advance.
While I personally keep and eye on module listing page and make list of modules to be uninstalled at the time of going live, usually the 'To Uninstall' list contains some UI wrapper modules like views_ui, devel, etc. But searching for any contrib module I came across unused_modules, I think it might be worth trying what this module gives out of the box.


How do you remove folders that are not needed anymore from the sites/all/modules folder?
https://www.drupal.org/project/unused_modules
How do you remove leftover database tables?

You can you schema module, which basically identifies tables and modules relation and also list down orphan tables, this can give you a list of tables which might be just left over tables.
Cleanup test data content.

delete_all module seems to allow to cleanup the test content with different variation via drush.