Assuming we have an all-core Drupal site; Is there a utility or even a Drush/Dconsole command to "clean" the database of anything which is not a node, or a taxonomy or any regular core-based data of all sorts ?

In other words, a utility or command to clean from the DB anything which is, for example, a remnant of a module that we installed and then deleted that is now stuck on the DB in several places and removing it manually can be sisiphyc and or tiresome (especially when you have several cases at once).

  • I think that drupal 8 does that when you uninstall a module. – Eyal Jul 13 '16 at 18:22

I don't think that this is possible because the core can not know what you need before you have it configured (fields, nodetypes etc).

You would need kind of a transaction checkpoint at the DB structure, and the possibility to rollback every structure manipulation and data therein that has happened after that point.

I usually have a system besides of my content staging system to test contributed modules. Copy content stage to dev, apply module on dev, test, rollback or move the module to content stage.

If you are the module dev yourself - make up your correct uninstalls :-)

  • 1
    I think you should rephrase your last parg, to something like "If you are aware of a module that has any type of issue with uninstaling it, then create an issue about it in its issue queue, and attach an appropriate patch that resolves it" ... After all, its open source, anybody can contribute, no? – Pierre.Vriens Jul 12 '16 at 11:34
  • 1
    I think you should leave this as-is. Great answer. Don't worry about putting tenuously related stuff about issue queues, it's not relevant. Doesn't help in any way to address the question, it's just a banal after thought. – Clive Jul 12 '16 at 11:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy