Posted by rhowk on January 14, 2013 at 10:54pm
I am fixing someone else's site. Somehow they managed to load modules fro the sites/default/modules dir instead of the sites/all/modules folder. The modules in question show up in the admin/build/modules/list but don't live in the proper folder. How could they have done this? I ask because I want to undo what they did and bring the site back into line with standards so I can fix a host of other problems. I'll figure it out eventually, but if someone could save me some time I would appreciate it!
Comments
Modules technically can be in
Modules technically can be in sites/default/modules. This just means though that the modules are only accessible to be used by the default site (which if there is only one site, is already the case). So while it's technically ok to be in that folder, it's true that the common recommendation is sites/all/modules, which makes the modules available to any multisites you are running on the same install. If you want to move them, the safest way is to disable all contributed modules (keep a log or screenshot to remember what to re-enable), then move the folders into sites/all/modules, then re-enable them. I've occasionally been able to move the modules without disabling them, but sometimes this causes errors, so the safest bet is to disable them first. Once you re-enable them, their location stored in the system table is automatically set to the new location. If something does end up stuck to the old path, you can manually edit the value in the database if you want, or run a quick query to replace the wrong paths.
-- David
davidnewkerk.com | absolutecross.com
View my Drupal lessons & guides
As David says, having modules
As David says, having modules in
sites/all/modulesis fine, unless you need a multisite setup.As for moving them, the few times I needed to do this I've been able to do so without disabling, by just moving folders and files and then running update.php - that does refresh file locations, too.
Doing a backup first is strongly recommended with either method, however.