Take the 2-minute tour ×
Drupal Answers is a question and answer site for Drupal developers and administrators. It's 100% free, no registration required.

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? –  tunic Apr 10 at 16:57
add comment

2 Answers 2

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.

Cheers,

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

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');

Source

share|improve this answer
add comment

Your Answer

 
discard

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.