Search code examples
drupal-6

Broken Image links after migrating a Drupal site from Local Machine to Live Server


Whats the simplest way to update the paths of the images after migrating the website from local machine to a live server. Most of the times I end up updating the paths manually. I m convinced that there must be a simpler way which i m missing out on.

Kindly suggest.


Solution

  • My guess is that the issue you're seeing is a result of not setting the filepath in the administration. If you go into the administration (admin/settings/file-system) and simply save the page, you'll define the value for the filepath (which should remove the issues).

    You could also set all files to use the original default (or local) directory as well via that interface.

    The issue, in case you're wondering, is that the variable_get call under the hood for the filepath is dynamic based on the sites directory that you're loading the settings.php file from. Once the value is set, it no longer resorts to the default setting and uses your value instead.

    If you're physically moving the files from the relative location they're at locally vs on the server, then I'm not sure there's much of a great way around that issue.