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,628
Likes: 85
Joined: Dec 2003
Posts: 6,628
Likes: 85
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,973
Likes: 154
UBB.threads Developer
UBB.threads Developer
Joined: Apr 2004
Posts: 1,973
Likes: 154
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.0 // wip: UBB.threads 8.0.1
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
Upgraded to ver8 - now can't login
by phoenix011235 - 10/24/2024 8:50 AM
Very weird error this morning.
by Baldeagle - 10/23/2024 5:35 PM
Help error and stop forum spam
by ehill - 10/23/2024 12:13 PM
Very slow web server response times
by Baldeagle - 10/18/2024 4:22 PM
Title in PM's
by Morgan - 10/16/2024 4:11 AM
Who's Online Now
3 members (Van, Ruben, 1 invisible), 781 guests, and 56 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.1
(Snapshot build 20240918)