Previous Thread
Next Thread
Print Thread
Hop To
#265991 03/15/2024 9:31 AM
Joined: Jun 2006
Posts: 319
Enthusiast
Enthusiast
Joined: Jun 2006
Posts: 319
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,562
Likes: 78
Joined: Dec 2003
Posts: 6,562
Likes: 78
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: 1,945
Likes: 145
UBB.threads Developer
UBB.threads Developer
Joined: Apr 2004
Posts: 1,945
Likes: 145
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: UBBT 7.7.5 // Preview: UBBT 8.0.0
isaac @ id242.com // my forum @ CelicaHobby.com
1 member likes this: Gizmo
Joined: Jun 2006
Posts: 319
Enthusiast
Enthusiast
Joined: Jun 2006
Posts: 319
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
Bots
by Outdoorking - 04/13/2024 5:08 PM
Can you add html to language files?
by Baldeagle - 04/07/2024 2:41 PM
Do I need to rebuild my database?
by Baldeagle - 04/07/2024 2:58 AM
This is not a bug, but a suggestion
by Baldeagle - 04/05/2024 11:25 PM
Is UBB.threads still going?
by Aaron101 - 04/01/2022 8:18 AM
Who's Online Now
1 members (1 invisible), 816 guests, and 465 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
Los Angeles
Los Angeles
by isaac, August 6
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Stones
Stones
by isaac, August 19
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20230217)