5

I know you are not supposed to do this, but for reasons beyond my control the location of my web root is different on my Dev and my production server. As a result everytime I copy the database from my production server to my Dev server, all of my modules become confused and point to the wrong file location. What is the recommended way to handle this?

1
  • 1
    What version of Drupal? From my personal experience (And from double checking the Systems table in a Database), D6 uses relative paths for Modules and Themes, so it doesn't matter where Drupal is located, just where your modules are stored relative to the Drupal root directory.
    – Decipher
    Commented Mar 9, 2011 at 4:45

4 Answers 4

3

If you are using Drush you can run the following commands to fix the module path problem, if you are using multisites then make sure you are in the sites/mysite.com directory (this must not be a symlink) before running these commands.

Drupal 6

drush eval "module_rebuild_cache();"
drush cc all

Drupal 7

drush eval "system_rebuild_module_data();"
drush cc all

(though as I've not tested I'm not sure this is needed on Drupal 7 anymore)

If Drush is new to you then here is the description from the Drush project page:

Drush is a command line shell and scripting interface for Drupal, a veritable Swiss Army knife designed to make life easier for those of us who spend some of our working hours hacking away at the command prompt.

2
  • If not running multisites you can run Drush from the root of the Drupal site, you don't need to be in sites/default.
    – Decipher
    Commented Mar 9, 2011 at 22:10
  • 1
    Decipher, I've corrected that now in my answer. Thanks!
    – Camsoft
    Commented Mar 9, 2011 at 22:20
0

The Alternative to the Drush approach, in the case you can not run Drush on your server, I have found to solutions for this sort of issue (when moving the modules to another directory):

  1. Go to /admin/build/modules and hit the submit button.

  2. Run update.php

While Drush is probably preferable, it's not always possible to have setup on your live hosting.

0

Absolutely essential to change the dev. server to be the same as the production server.

If you don't there will come a day when you wish you had...

Even if it is outside of your control I'd recommend making a good case to however is in charge to change the development server.

0

When necessary, I mimic the production server file structure using symlinks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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