3

I need to run a simple fix in my Drupal 7 website. The website administrator, not being a Drupal specialist, installed the SMTP module in the root /modules folder, instead of the /sites/all/modules folder. Now I need to upgrade the SMTP module and noticed the mistake. My first impulse was to move the SMTP folder from /modules into /sites/all/modules, and then proceed with the regular upgrade.

My question is: do you think that moving the SMTP folder from root /modules into /sites/all/modules could cause any problems, like data loss or website crash?

6

It’s OK (in most cases). Drupal 7 will find new destination of module after registry rebuilding. So, just move folders in proper destination and clear all cache.

It works for moving modules, but not for disabling and uninstalling. Don't remove module folder before complete uninstalling.

Update: I can move module folder even without disabling that module, because I use Drush for immediate cache clearing. In other situations it will be useful to disable module before moving.

| improve this answer | |
  • I think the main reason to worry is the fact that Drupal stores module files’ paths in system table. But there is system_update_files_database() function which resolves paths while cache flushing. – kalabro Aug 5 '12 at 8:19
  • Ok, it worked for me, but after some issues. First time I tried moving, the site broke with the white screen of death and a message I unfortunately did not keep. I put the folder back up on the original spot. The site resumed working. After some 2 or 3 unsuccessful attempts where I did things in a slightly different manner, I cleared cache prior to removing the SMTP folder from the root /modules folder. Right after removing, I cleared cache again and voilà, it worked. – Marcos Buarque Aug 6 '12 at 4:52
  • You should flush cache immediately after moving folder, but you tried to load site normally to find link for cache clearing :) I updated my answer. – kalabro Aug 6 '12 at 6:17

Your Answer

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

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