Is it safe to delete the /module folder? I see that the /module folder still exists and a /module/contrib folder has the updated module folders in it.


  



composer update has updated the site to 8.9
composer update will not update any of the modules still shown in /modules (webform for example)
When running composer update, Composer reports installing Webform 8.5.16, but it doesn't in fact install it and the site still reports Webform 8.x-5.4-beta1


Many other modules are also not updating
The modules in /module are the old versions, while the newer versions are in /module/contrib 
Drupal think the modules are in the old path (for example, /module/webform)



What is the safest way to fix the problem?
Delete folders in /module folder other than contrib and rerun composer update?

I have already executed the following commands.


composer composerize 
composer cc
composer self-update
sudo rm -Rf composer.lock vendor/
composer update
Yes, you should be able to delete the versions of the modules directly under /modules, and clear cache; in theory that should be enough to get the system to re-register the same modules from their new locations.

Take a backup of the files and database first, and if you want to play it safe, delete one module folder at a time, running drush cr and checking that the version Drupal now sees is correct after each deletion.

It's probably wise to run drush updb after this, in case any of module versions have incremented and there are updates.