Last updated October 27, 2009. Created by add1sun on October 15, 2007.
Edited by LeeHunter, DyanneNova. Log in to edit this page.
The best practice is to keep all of your contributed modules and themes in the sites/all/modules or sites/all/themes directory, as appropriate. If you are upgrading from a previous version or have already installed them in the main modules or themes directories and you wish to move them, it is possible but you just need to make sure Drupal knows you moved them.
- Go to Administer > Site Building > Modules (or Themes) and disable the modules/themes you wish to move.
- Move the modules/themes to the new directory you wish them to live in.
- Now go back and enable the modules again. Drupal will locate them in the new directory and update the system table as needed.
The system table gets rebuilt when you visit: admin/build/modules. So if your module has moved and you've forgotten to disable it then just visit the modules page and you should be fine. Typically you'll see a PHP "Fatal error: Call to undefined function myfunction()" error when Drupal doesn't know where your module is.
This is not necessarily true as of Drupal 6.
Some contributed modules will NOT come back online because of paths stored in their settings and may cause various database errors. Always remember to make a complete backup first. In these cases, try uninstalling the module completely. Or just leave it where it was before you moved it. It's also possible to modify the database directly to change the path if necessary.
Comments
Correct Path for Contributed Modules Directory
Do remember to use lowercase in naming the path for your contributed modules. Drupal (on some web servers) will only recognize "sites/all/modules" and not "sites/all/Modules". I blew a couple hours figuring that one out
Site slow after moving.
I moved a bunch of modules (in batches) from core to sites/all/modules using this method, and now my site is super slow. About a 28 second load time just to view a page. All the modules seem to be working as they were before and I'm not getting any errors. Working on trying to figure this out.