Drupal Answers is a question and answer site for Drupal developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I recently copied my site from the dev server to a test server, and I noticed that a lot of images which were placed using the Media module have src= attributes that point to the old server. Ie., <img src='http://oldsite.com'...> I don't see any settings within the configurable options for the Media module which will update the links.

I know that WordPress has a handy link updater plug-in called Velvet Blue, or something like that. Does anyone know of a similar module for Drupal?

share|improve this question
Just for the record.. What Drupal version? – sanzante Apr 10 '14 at 16:57
up vote 5 down vote accepted

What you are looking for is the Pathologic module.

Pathologic is an input filter which can correct paths in links and images in your Drupal content in situations which would otherwise cause them to “break;” for example, if the URL of the site changes, or the content was moved to a different server.


share|improve this answer
Exactly what I was looking for! Thanks! – eljefejb Apr 10 '14 at 18:03

I was recently working on Drupal multisite to a single site conversion and ran into the same problem. I solved by running this SQL command

update `files` set filepath = replace(filepath,'sites/<my_site_name>/files','sites/default/files');

which updated the file paths of my files in the files table. You can do something similar for images used in content. I think you need to target the node_revision table and the body column. So, something like this:

update `node_revision` set body = replace(body,'sites/<my_site_name>/files','sites/default/files');


share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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