Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: Kathryn_ on May 11, 2019, 11:43:53 AM

Title: I would like advice on Db Query
Post by: Kathryn_ 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 (https://roseweb.net)
Title: Re: I would like advice on Db Query
Post by: shawnb61 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.   
Title: Re: I would like advice on Db Query
Post by: Arantor 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'?
Title: Re: I would like advice on Db Query
Post by: Kathryn_ 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
Title: Re: I would like advice on Db Query
Post by: Arantor on May 11, 2019, 02:24:16 PM
Are you losing the .jpg on the end as well?
Title: Re: I would like advice on Db Query
Post by: Kathryn_ on May 11, 2019, 02:32:32 PM
that was a posting error on here sorry... no not loosing anything as far as extensions
Title: Re: I would like advice on Db Query
Post by: Arantor on May 11, 2019, 02:48:20 PM
UPDATE smf_messages SET body = REPLACE(body, 'http://forum.roseweb.net/', 'http://roseweb.net/');
Title: Re: I would like advice on Db Query
Post by: Kathryn_ on May 11, 2019, 02:55:57 PM
Okay thank you so much..
Title: Re: I would like advice on Db Query
Post by: Kathryn_ 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.