|
Joined: May 2008
Posts: 753 Likes: 1
Old Hand
|
Old Hand
Joined: May 2008
Posts: 753 Likes: 1 |
a couple of years ago I sold my vannin.com domain name, and have been using vanninG.com since. I still have tons of old posts that contain the old url. how would I run a sql query to find and replace ann instances of vannin.com with vanning.com in user posts? this is what I came up with, but don't want to run it without being sure. UPDATE
[ ubbt_POSTS ]
SET
[ POST_BODY ] =
REPLACE
([ POST_BODY ], '[vannin]', '[vanning]');
"No matter where you go, there you are." "If you can't do something smart, Do something right" "There are three kinds of people in the world, those who can count, and those who can't"
|
|
|
|
Joined: May 2008
Posts: 753 Likes: 1
Old Hand
|
Old Hand
Joined: May 2008
Posts: 753 Likes: 1 |
or would this be better?
update UBB_POSTS set POST_BODY = replace(
POST_BODY, 'http://vannin.com/',
'https://www.vanning.com/');
"No matter where you go, there you are." "If you can't do something smart, Do something right" "There are three kinds of people in the world, those who can count, and those who can't"
|
|
|
|
Joined: May 2008
Posts: 753 Likes: 1
Old Hand
|
Old Hand
Joined: May 2008
Posts: 753 Likes: 1 |
I tried the second one, it seemed to work. I had a post open with the old link, ran that, looked again and the links appeared to be correct, but when I went to look at it via edit, they were still the old link. it changed how it appeared visibly in the post, but not the actual url.
"No matter where you go, there you are." "If you can't do something smart, Do something right" "There are three kinds of people in the world, those who can count, and those who can't"
|
|
|
|
Joined: Apr 2004
Posts: 1,945 Likes: 145
|
Joined: Apr 2004
Posts: 1,945 Likes: 145 |
** MAKE A BACKUP ** 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 USAGE EXAMPLE FOR HTTP => HTTPSUPDATE ubbt_POSTS SET POST_BODY = replace(POST_BODY, 'http://EXAMPLE.com', 'https://EXAMPLE.com') Run CONTENT REBUILDER > REBUILD POSTS afterwards.--- FOR REFERENCE:Posts- ubbt_TOPICS - TOPIC_SUBJECT
- ubbt_POSTS - POST_SUBJECT
- ubbt_POSTS - POST_DEFAULT_BODY
- ubbt_POSTS - POST_BODY
Private Messages- ubbt_PRIVATE_MESSAGE_TOPICS - TOPIC_SUBJECT
- ubbt_PRIVATE_MESSAGE_POSTS - POST_DEFAULT_BODY
- ubbt_PRIVATE_MESSAGE_POSTS - POST_BODY
Profiles- ubbt_USER_PROFILE - USER_AVATAR
- ubbt_PROFILE_COMMENTS - COMMENT_BODY
|
|
|
|
Joined: May 2008
Posts: 753 Likes: 1
Old Hand
|
Old Hand
Joined: May 2008
Posts: 753 Likes: 1 |
so.. I would want UPDATE
UBB_POSTS
SET
POST_DEFAULT_BODY =
REPLACE
(
POST_DEFAULT_BODY,
'http://vannin.com/',
'https://www.vanning.com/'
);
"No matter where you go, there you are." "If you can't do something smart, Do something right" "There are three kinds of people in the world, those who can count, and those who can't"
|
|
|
|
Joined: May 2008
Posts: 753 Likes: 1
Old Hand
|
Old Hand
Joined: May 2008
Posts: 753 Likes: 1 |
oh, I see your example, just formatted differently, but says the same thing. thanks!
"No matter where you go, there you are." "If you can't do something smart, Do something right" "There are three kinds of people in the world, those who can count, and those who can't"
|
|
|
|
Joined: Apr 2004
Posts: 1,945 Likes: 145
|
Joined: Apr 2004
Posts: 1,945 Likes: 145 |
yes. thats correct. and then run your content rebuilder afterwards.
Its advised that you should probably close your forums when making multiple wide-scale database changes such as these. the Content Rebuilder already closes your forum while its doing its work. In addition, if you are making changes that touch many of your largest tables at once, be sure to have a backup. A backup is something you hope you never need, but glad you have it if you ever do need it.
|
|
|
Bots
by Outdoorking - 04/13/2024 5:08 PM
|
|
|
|
|
|
1 members (1 invisible),
702
guests, and
193
robots. |
Key:
Admin,
Global Mod,
Mod
|
|
|
|