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?
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.
drush eval "module_rebuild_cache();" drush cc all
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.
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):
Go to /admin/build/modules and hit the submit button.
While Drush is probably preferable, it's not always possible to have setup on your live hosting.