SitePoint Sponsor |
|
User Tag List
Results 1 to 4 of 4
Hybrid View
-
Jan 20, 2005, 07:57 #1
- Join Date
- Jan 2005
- Location
- Belgrade
- Posts
- 2
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Find / Replace within MEMO field?
I have a table where all the news text is stored in MEMO field, including image references such as <img src="archive.xyz.com/image.jpg">
We are moving to another server and changing the URL to something else.
Is there an easy way to do a find / replace and change all the image URLs?
Thanks a lot,
Alex
-
Jan 20, 2005, 08:15 #2
- Join Date
- Mar 2001
- Location
- Hailsham, UK
- Posts
- 62
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Perhaps a database dump to a text/sql file and then use a text editor to search and replace. Then import the data again. If it's possible you may want to remove the domain name part of the URL and do absolute URLs from the start of the site (if it's all on one domain) so you won't need to do it again.
Eg, from <img src="archive.xyz.com/image.jpg"> to <img src="/image.jpg">
Kind regards, Ian
-
Jan 20, 2005, 12:22 #3
- Join Date
- Jan 2005
- Location
- Belgrade
- Posts
- 2
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Is this really possible - to find/replace everything in the dump, then reload it up to the server? That would be way cool.
As for the absolute URL, that's exactly what we're trying to do. Up to now the content was on a separate server "archive.xyz.com", now it will be on the same one, hence we need to search and replace, i.e. delete the part before the filename.
-
Jan 20, 2005, 14:04 #4
- Join Date
- Mar 2001
- Location
- Hailsham, UK
- Posts
- 62
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Yes, you can either use the mysqldump tool (I think you need ssh or telnet access to the server for this; myslqdump is usually always installed with mysql) or my preferred way is to use the web-based phpMyAdmin which might already be set up by your ISP. Good luck!
Bookmarks