SMF Support > SMF 1.1.x Support
Cleaning up links to posts, after moving forum to new domain
hchute:
I plan to move my forum to a new domain.
So I'll copy over my forum folders, restore the database in the new domain, and run repair_settings.php to set the new paths up.
Question:
- My members have made many posts where the text of the post includes a link to some other post. Right now those links are of the form "http://www.my-old-domain.com/index.php/topic,37464.0.html".
- I am thinking I am going to have to manually (or through some SQL scripts) update the content of those posts, to point to my new domain name.
Any shortcuts for this, or tips as far as how to proceed? I'm assuming that this must be a common situation faced by admins who are moving a forum from one domain to another.
xenovanis:
! Make a backup of your database !
Run this query in phpMyAdmin:
--- Code: ---UPDATE smf_messages set BODY = replace(body, 'http://www.your-oldsite.com', 'http://www.your-newsite.com')
--- End code ---
hchute:
Thank you, ma'am! That's perfect, and much appreciated.
perfec2:
I'm the process of implementing the same.
Would "UPDATE smf_messages set BODY = replace(body, 'http://www.your-oldsite.com', 'http://www.your-newsite.com')"
Replace also "http://your-oldsite.com to http://your-newsite.com " too or do one needs to run them independently for the protocol http:// only?
Arantor:
Yes you need to do both replaces since the bit that's different is in the middle of the bit you're replacing.
Navigation
[0] Message Index
[#] Next page
Go to full version