When I used to HTML by hand, search 'n' replace was easy with text editor. I finally made the site live last night by modifying htaccess, only to find path written in node bodies are all wrong. Where it says: src/href="sites/.. It should had said: src/href="/sites/.. There are million places I have to edit. How can I do this Search and Replace in one shot? P.S., I like Image_assist because thumbnail popups to original sized image. I don't like Filtered HTML since I don't get full control, but Image_assist puts absolute path including the domain name so I typed path manually every time I added image. Now it's biting me. Embedding image and make it act as I wish has been one of the most frustrating issues with Drupal so far. I am also frustrated AcidFree. How are others dealing with this? -- - Hiro Hiroaki Honshuku, A-NO-NE Music, Boston, MA <http://a-no-ne.com> <http://anonemusic.com>
A fast solution is to dump the database into an .sql file, and do a search&replace on it. Another method would be to do a mysql update using the replace function: http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_replac... regards, s Wed, 13 Jun 2007 10:17:30 -0400 -n "A-NO-NE Music" <madflute@anonemusic.com> írta:
I finally made the site live last night by modifying htaccess, only to find path written in node bodies are all wrong. Where it says: src/href="sites/.. It should had said: src/href="/sites/..
There are million places I have to edit. How can I do this Search and Replace in one shot?
In a SQL prompt you could do UPDATE [table_name] SET [field_name] = REPLACE([field_name],'[string_to_find]','[string_to_replace]'); Replace the [stuff] including the [] with the tables you want to effect and the fields... So UPDATE node_revisions SET body = REPLACE(body, Red¹, Blue¹); Would replace all Reds with Blues in the table node_revisions and the field body. BACK YOUR DATABASE UP BEFORE YOU TRY THIS! -- Mike Bishop Digital Mercenary ADAMSON ADVERTISING P. 314.727.9500 x 1237 M. 314.537.6723 From: sessy <sessy@citromail.hu> Reply-To: <support@drupal.org> Date: Wed, 13 Jun 2007 23:45:33 +0000 To: <support@drupal.org> Subject: Re: [support] Search and Replace A fast solution is to dump the database into an .sql file, and do a search&replace on it. Another method would be to do a mysql update using the replace function: http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_replac e regards, s Wed, 13 Jun 2007 10:17:30 -0400 -n "A-NO-NE Music" <madflute@anonemusic.com> írta:
I finally made the site live last night by modifying htaccess, only to find path written in node bodies are all wrong. Where it says: src/href="sites/.. It should had said: src/href="/sites/..
There are million places I have to edit. How can I do this Search and Replace in one shot? -- [ Drupal support list | http://lists.drupal.org/ ]
Mike Bishop / 2007/06/13 / 05:48 PM wrote:
In a SQL prompt you could do
UPDATE [table_name] SET [field_name] = REPLACE([field_name],'[string_to_find]','[string_to_replace]');
Thank you so much for this. Actually I chickened out and I ended up with retyping manually. I saved your response and put it in my safe. I will practice :-) -- - Hiro Hiroaki Honshuku, A-NO-NE Music, Boston, MA <http://a-no-ne.com> <http://anonemusic.com>
participants (3)
-
A-NO-NE Music -
Mike Bishop -
sessy