Previous Thread
Next Thread
Print Thread
Hop To
#265991 03/15/2024 9:31 AM
Joined: Jun 2006
Posts: 353
Enthusiast
Enthusiast
Joined: Jun 2006
Posts: 353
Hi all,

I am trying to find an easier way to edit links in post rather than doing one by one as we have over 100,000 thousand post and quite a lot of images that have been uploaded in the post as well.

We had the site moved to a new server and changed the url address from the following:

https://www.outdoorking.com/forum/

To the following:

https://www.outdoorking-forum.com.au/forum/

I would like to know if this can be done by a sql command to the database and if so what would the code be please.

Last edited by Outdoorking; 03/15/2024 9:35 AM.
Joined: Dec 2003
Posts: 6,649
Likes: 88
Joined: Dec 2003
Posts: 6,649
Likes: 88
You use a update query like
https://www.ubbcentral.com/forums/u...your-forum-from-http-to-https#Post260501

But you would do it for the path and not just https.

Remember there are two fields in ubbt_POSTS
POST BODY and POST BODY Default

Also there is no UNDO
So when you specify what to change grab a chunk of the path
like https://www.ubbcentral.com/forums to say https://www.ubbcentral.com/ubb/forums
not just something that could be part of another word or something you want unique to change

All in all it is very quick
I first created all the query's in notepad then copy paste to mysql

It runs very quick

Last edited by Ruben; 03/15/2024 4:17 PM. Reason: Added Comment

Blue Man Group
There is no such thing as stupid questions. Just stupid answers
Joined: Apr 2004
Posts: 2,032
Likes: 176
UBB.threads Developer
UBB.threads Developer
Joined: Apr 2004
Posts: 2,032
Likes: 176
Read through this thread, as it covers all of the places that need updating.
https://www.ubbcentral.com/forums/u...transition-your-forum-from-http-to-https

click the SHOW/HIDE button in that thread to reveal the SQL commands required to do your custom search/replace task


Search and Replace strings inside "text" fields. (COLUMN,'oldphrase','newphrase')
** BE VERY CAREFUL OF "POST_DEFAULT_BODY" and "POST_BODY" USAGE - DO NOT INTERCHANGE THEM
• POST_DEFAULT_BODY - [BBcode] This is the original post. CONTENT REBUILDER > REBUILD POSTS takes this and converts it to POST_BODY [HTML]
• POST_BODY - [HTML] This is shown to the user. it is generated from POST_DEFAULT_BODY

EXAMPLE 1.
UPDATE ubbt_POSTS
SET POST_DEFAULT_BODY = replace(POST_DEFAULT_BODY,'old','new');

UPDATE ubbt_POSTS
SET POST_BODY = replace(POST_BODY,'old','new');


pay close attention to NAMES USED FOR EVERYTHING.
always have a backups for anything like this.


current developer of UBB.threads php forum software
current release: UBB.threads 8.0.1 // wip: UBB.threads 8.1.0
isaac @ id242.com // my forum @ CelicaHobby.com
1 member likes this: Gizmo
Joined: Jun 2006
Posts: 353
Enthusiast
Enthusiast
Joined: Jun 2006
Posts: 353
Thank you all for the information supplied.

It all worked as ite should.

Thanks again.


Link Copied to Clipboard
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
PHP 8 bug in membermanage.tmpl
by phoenix011235 - 09/08/2026 7:47 PM
Are any of these legitmate?
by Baldeagle - 09/06/2026 1:37 PM
After server reboot
by Morgan - 09/02/2026 8:27 AM
Email Settings
by Outdoorking - 05/13/2026 2:44 AM
Who's Online Now
1 members (Gizmo), 156 guests, and 110 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
Ride safe!
Ride safe!
by Morgan, December 7
Los Angeles
Los Angeles
by isaac, August 6
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Powered by UBB.threads™ PHP Forum Software 8.1.0
(Snapshot build 20260527)