<HTML>
<HEAD>
<TITLE>Re: [support] Search and Replace</TITLE>
</HEAD>
<BODY>
<FONT FACE="Verdana, Helvetica, Arial"><SPAN STYLE='font-size:12.0px'>In a SQL prompt you could do<BR>
<BR>
UPDATE [table_name] SET [field_name] = REPLACE([field_name],'[string_to_find]','[string_to_replace]');<BR>
<BR>
Replace the [stuff] including the [] with the tables you want to effect and the fields...<BR>
<BR>
So<BR>
UPDATE node_revisions SET body = REPLACE(body, ‘Red’, ‘Blue’);<BR>
<BR>
Would replace all Reds with Blues in the table node_revisions and the field body.<BR>
<BR>
BACK YOUR DATABASE UP BEFORE YOU TRY THIS!<BR>
<BR>
<BR>
-- <BR>
<BR>
Mike Bishop<BR>
Digital Mercenary <BR>
<BR>
<FONT COLOR="#FF8000"><B>ADAMSON ADVERTISING<BR>
</B></FONT>P. 314.727.9500 x 1237<BR>
M. 314.537.6723<BR>
<BR>
<BR>
<HR ALIGN=CENTER SIZE="3" WIDTH="95%"><B>From: </B>sessy <sessy@citromail.hu><BR>
<B>Reply-To: </B><support@drupal.org><BR>
<B>Date: </B>Wed, 13 Jun 2007 23:45:33 +0000<BR>
<B>To: </B><support@drupal.org><BR>
<B>Subject: </B>Re: [support] Search and Replace<BR>
<BR>
</SPAN></FONT><SPAN STYLE='font-size:12.0px'><FONT FACE="Monaco, Courier New">A fast solution is to dump the database into an .sql file, and do a search&replace on it.<BR>
Another method would be to do a mysql update using the replace function:<BR>
<a href="http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_replace">http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_replace</a><BR>
<BR>
regards,<BR>
<BR>
s<BR>
<BR>
Wed, 13 Jun 2007 10:17:30 -0400 -n<BR>
"A-NO-NE Music" <madflute@anonemusic.com> írta:<BR>
<BR>
> I finally made the site live last night by modifying htaccess, only to<BR>
> find path written in node bodies are all wrong. Where it says:<BR>
> src/href="sites/..<BR>
> It should had said:<BR>
> src/href="/sites/..<BR>
> <BR>
> There are million places I have to edit. How can I do this Search and<BR>
> Replace in one shot?<BR>
-- <BR>
[ Drupal support list | <a href="http://lists.drupal.org/">http://lists.drupal.org/</a> ]<BR>
</FONT></SPAN>
</BODY>
</HTML>