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?