Recent Topics

1 Jan 27, 2008 12:04    

My b2evolution Version: 2.x

I've migrated a massive database from 1.8 to 2.3 (2.4 any minute now) on a new server. About 150 posts, each with 3 or 4 images. I've just noticed that all the inline image links in the blog text not surprisingly point to the old server. So when I wipe off the old server, no more images :( . I've moved a copy of all the necessary image files to the new server media folder no problem, and the new path will be exactly the same as the old except the domain name.

My query: is there any way of changing all these links other than hand-editing? Can I do this with MySQL?

2 Jan 27, 2008 12:10

You don't have problems here. SQL is plain text, so you can simply do a find/replace. But do test thouroughly before you go online and keep a backup etc.

B2evo uses the $baseurl to be able to use relative paths. If you start using them also a move to a new server becomes even easier than this.

Good luck

3 Jan 27, 2008 13:30

Thanks! I'll have a go.

4 Jan 27, 2008 13:45

don't quote me, but I believe you can do something like :

update T_items__item set item_content = replace( 'http://old.domain.com/', 'http://new.domain.com/' ) where 1

¥

*edit*
Correction, it should look like this :

update T_items__item set item_content =  (replace( item_content, 'http://old.domain.com/', 'http://new.domain.com/' ) )

5 Jan 28, 2008 19:22

Cheers ¥åßßå - that sounds even better. Uploading a 24Mb database is a pain unless there's a good reason! I assume this is a SQL query?

6 Jan 28, 2008 19:39

it is, if you run it in PhpMyAdmin or similar then change the "T_" to "evo_" or whatever your table prefix is ;)

Ohh yeah, and take a backup of your backup before you run it .... just in case ;)

¥

7 Jan 28, 2008 20:07

Thanks - and yes I will backup. I've already got a nice collection of these backups building up into a pile on my desktop. A few more won't hur...
:)

8 Jan 28, 2008 20:11

Easiest way to take a backup is to create a new db and copy the tables across, no 26meg down/up to do ;) ( or use ssh and dump tables to a file on your server )

..... and it'd save yer desktop a fair amount of strain ;)

¥

9 Jan 28, 2008 23:43

100% success, thanks Yabba and Afwas. That sure beats a manual trawl. Actually, it was post_content, not item_content. But I managed to sort that out myself. Cheers.

10 Jan 29, 2008 00:19

yay, chalk another one up for the wetter side of the pond ;)

¥


Form is loading...