We Recommend

SQL Cookbook SQL Cookbook
Written in O'Reilly's popular Problem/Solution/Discussion style, the SQL Cookbook is sure to please. Anthony's credo is: "When it comes down to it, we all go to work, we all have bills to pay, and we all want to go home at a reasonable time and enjoy what's still available of our days." The SQL Cookbook moves quickly from problem to solution, saving you time each step of the way.


Posted By

shrop on 07/17/08


Tagged

mysql drupal


Versions (?)


Who likes this?

2 people have marked this snippet as a favorite

tgbdad
basicmagic


MySQL Find and Replace Drupal filepaths in files table


Published in: SQL 


This is useful if you are changing a Drupal site's file upload path and/or changing from a private to a public file store.

  1. UPDATE files SET filepath = REPLACE(filepath,'path/to/search','path/to/replace');

Report this snippet 

Comments

RSS Icon Subscribe to comments
Posted By: tgbdad on August 16, 2008

Thanks, Shrop. This worked like a charm. When using the audio module, the same query works on the audio_file table, too.

Posted By: tgbdad on August 20, 2008

also works with picture field in users table.

You need to login to post a comment.