How to change Image Paths in a Subdirectory in Drupal 7

asked Apr 10, 2013 in Website Builder by DruNew (1,930 points)
I installed Drupal in a  subdirectory and now I want to move it to  another subdirectory. All my images were inserted with the text editor and they all have a path with the old subdirectory name so now if I move the installation the all paths will break. Is there a module or an SQL command that I can use to fix this without having to manually adjust all my image paths? I would appreciate any help in this
Many thanks in advanced

1 Answer

0 like 0 dislike
answered Apr 10, 2013 by RalphK (5,800 points)
Try this SQL comman
Figured it out - run some sql replacement on the field_data_body table and flush the cache
UPDATE field_data SET body_value = REPLACE(body_value,'src="/yoursource','src="/thenewsource');