0

We have a Drupal 8 application which has modules directly in the directory "/modules" on the file system. I want to move a contributed module from the directory "/modules" to the directory "/modules/contrib". Do I need to uninstall the module before doing it?

Are there any steps that need to be performed before and after moving the module?

6
  • You probably have to regenerate the autoloader files and dump any running memory cache. – Kevin Jan 17 '19 at 22:22
  • @Kevin How can we regenerate the autoloader files? And would clearing the cache through the admin interface by going to '/admin/config/development/performance', dump the running memory cache? – Martin Borugadda Jan 17 '19 at 22:28
  • composer dump-autoload @MartinBorugadda, and yes (or run drush cr) – Clive Jan 17 '19 at 23:06
  • Why don't you simply try it out yourself on your local machlne? – leymannx Jan 18 '19 at 0:11
  • @leymannx I tried it on my dev and nothing seems to be broke. But, I am not very sure of how the internals of Drupal behave. Wanted to be sure if something gets broke in the future – Martin Borugadda Jan 18 '19 at 5:56
1

As with most things, I suggested testing it out on a development/test site before trying on the live site. It's likely that the specific set of contribs and the libraries they use will affect the success of this operation.

How did you install the modules? Do you use a composer workflow?

In general, some paths stored in different places are going to be wrong. To fix that, you will need to edit those paths or have Drupal figure out the new paths. I believe doing a cache rebuild (e.g. drush cr) will fix that problem.

Not the answer you're looking for? Browse other questions tagged or ask your own question.