Search & Replace site name in phpBB 3.0.7 database

Get help with installation and running phpBB 3.0.x here. Please do not post bug reports, feature requests, or MOD-related questions here.
Suggested Hosts
Forum rules
END OF SUPPORT: 1 January 2017 (announcement)
Locked
John T. Folden
Registered User
Posts: 188
Joined: Tue Sep 04, 2007 12:16 am

Search & Replace site name in phpBB 3.0.7 database

Post by John T. Folden » Thu Aug 12, 2010 9:09 am

I run a number of websites that all use the same forum. I recently moved one of these sites to a new domain and now have references in forum posts pointing to a location that no longer exists. How would I do a find and replace to take care of this

I need to replace a name in the format of site-name.info with site-name2.info

Thanks!
The Blue Whale Pub - SPN/SF/F TV Discussion Forum
ZOMBIE ALERT: The Walking Dead are coming to AMC!

User avatar
AmigoJack
Registered User
Posts: 5601
Joined: Tue Jun 15, 2010 11:33 am
Location: グリーン ヒル ゾーン
Contact:

Re: Search & Replace site name in phpBB 3.0.7 database

Post by AmigoJack » Thu Aug 12, 2010 9:20 am

You need to perform an SQL command. Don't forget to backup your database in case the result is not fitting your needs.

Code: Select all

UPDATE phpbb_posts SET post_text= REPLACE( post_text, 'site-name.info', 'site-name2.info' );
The worst thing about censorship is ███████████
Affin wrote:
Tue Nov 20, 2018 9:51 am
The problem is probably not my English but you do not want to understand correctly.
...
We will not come anybody anyway, nevertheless, it's best to shit this.

User avatar
stevemaury
Support Team Member
Support Team Member
Posts: 50577
Joined: Thu Nov 02, 2006 12:21 am
Location: The U.P.
Name: Steve
Contact:

Re: Search & Replace site name in phpBB 3.0.7 database

Post by stevemaury » Thu Aug 12, 2010 3:02 pm

If they are in [url] tags, you will need this, too:

Code: Select all

update phpbb_posts set post_text = replace(post_text, 'site-name.info', 'site-name2.info')
For REALLY good and VERY inexpensive hosting CLICK HERE

I can stop all your spam. I can upgrade or update your Board. PM or email me. (Paid support)

John T. Folden
Registered User
Posts: 188
Joined: Tue Sep 04, 2007 12:16 am

Re: Search & Replace site name in phpBB 3.0.7 database

Post by John T. Folden » Thu Aug 12, 2010 8:09 pm

stevemaury wrote:If they are in [url] tags, you will need this, too:

Code: Select all

update phpbb_posts set post_text = replace(post_text, 'site-name.info', 'site-name2.info')
They're probably not in url tags, however there are quite a few using the img bbcode. Same thing?
The Blue Whale Pub - SPN/SF/F TV Discussion Forum
ZOMBIE ALERT: The Walking Dead are coming to AMC!

User avatar
stevemaury
Support Team Member
Support Team Member
Posts: 50577
Joined: Thu Nov 02, 2006 12:21 am
Location: The U.P.
Name: Steve
Contact:

Re: Search & Replace site name in phpBB 3.0.7 database

Post by stevemaury » Thu Aug 12, 2010 8:48 pm

Yes.
For REALLY good and VERY inexpensive hosting CLICK HERE

I can stop all your spam. I can upgrade or update your Board. PM or email me. (Paid support)

Locked

Return to “[3.0.x] Support Forum”