Advertisement:

Author Topic: I would like advice on Db Query  (Read 420 times)

Offline Kathryn_

  • Semi-Newbie
  • *
  • Posts: 97
I would like advice on Db Query
« on: May 11, 2019, 11:43:53 AM »
I was advised not to work directly with database with my simple machines site. I moved my site from root to public_html and now am stuck with having to recreate the entire site which I got done finally from January 2019 start, every link needs to be modified. they are all forum.site I would not complain aside from the fact all my pictures and the five links I have on each post to the ebook formats. I am talking correcting manually a whole lot of links.  I am hoping that there is a mysql query I could use and what would that possibly be. I have a Db backup to use if things go haywire 

thank you
Site

Online shawnb61

  • Support Specialist
  • Sophist Member
  • *
  • Posts: 1,254
    • sbulen on GitHub
Re: I would like advice on Db Query
« Reply #1 on: May 11, 2019, 01:18:43 PM »
You do not have to change a lot to move a forum's location.  There is only a handful of key settings that need to be adjusted.

The best way to approach this is to use repair_settings.php, a tool designed to help you do that. 

https://wiki.simplemachines.org/smf/Repair_settings.php

Start there first!

If you continue to have issues, share the exact message you're getting.   
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,196
    • StoryBB/StoryBB on GitHub
Re: I would like advice on Db Query
« Reply #2 on: May 11, 2019, 01:43:52 PM »
Um, the issue is that there are links in posts that need fixing, something repair_settings can't do...

To the OP, do you have an example of a link that needs changing, e.g. the 'what it is now' and 'what it needs to become'?
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline Kathryn_

  • Semi-Newbie
  • *
  • Posts: 97
Re: I would like advice on Db Query
« Reply #3 on: May 11, 2019, 01:59:38 PM »
Yes...

https://forum.roseweb.net/Images/Audiobook.jpg

https://roseweb.net/Images/Audiobook


I did use the repair_settings with the knowledge it would not change the links

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,196
    • StoryBB/StoryBB on GitHub
Re: I would like advice on Db Query
« Reply #4 on: May 11, 2019, 02:24:16 PM »
Are you losing the .jpg on the end as well?
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline Kathryn_

  • Semi-Newbie
  • *
  • Posts: 97
Re: I would like advice on Db Query
« Reply #5 on: May 11, 2019, 02:32:32 PM »
that was a posting error on here sorry... no not loosing anything as far as extensions

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,196
    • StoryBB/StoryBB on GitHub
Re: I would like advice on Db Query
« Reply #6 on: May 11, 2019, 02:48:20 PM »
UPDATE smf_messages SET body = REPLACE(body, 'http://forum.roseweb.net/', 'http://roseweb.net/');
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline Kathryn_

  • Semi-Newbie
  • *
  • Posts: 97
Re: I would like advice on Db Query
« Reply #7 on: May 11, 2019, 02:55:57 PM »
Okay thank you so much..

Offline Kathryn_

  • Semi-Newbie
  • *
  • Posts: 97
Re: I would like advice on Db Query
« Reply #8 on: May 11, 2019, 07:24:58 PM »
It worked and you have saved me so much time... thank you for listening to and solving the situation for me.