Note: This is not a duplicate of The site has a mix of modules installed manually and via Composer: Can I move all to Composer? As this question below involves different folder locations.

I currently have modules installed via the Drupal UI (/admin/modules/install) which have installed in the directory /modules.

And I also have composer installed modules which are added to the directory /modules/contrib

Task: To move modules over to Composer managed.

I have run "composer require drupal/MODULE" which has put the module in the /modules/contrib location. But now there are 2 copies and upon refresh & clear cache, Drupal is still using the old module location. (I can tell as the composer installed module is a newer version)

I would prefer not to have to uninstall all the modules that need moving as it can cause issues.

I have tried just removing the module from directory /modules (leaving the new composer installed module in modules/contrib), but I get the WSOD.

Question: How do I switch modules over to Composer managed with a different directory location?

  • 1
    Just delete the old module folders and rebuild caches, everything else will take care of itself – Clive Apr 28 at 18:33
  • Try drush updb after deleting modules – Prestosaurus Apr 29 at 14:11

Your Answer

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

Browse other questions tagged or ask your own question.