Is there any SMF Mod that works like "Velvet Blues Update URLs"?

Started by panelpro, August 27, 2018, 05:56:41 PM

Previous topic - Next topic

panelpro

I have this old forum that has undergone several URL changes over the years. From forum.xyz.com, to xyz.com/forum, to forum.zyx.com to zyx.com/forum and back to forum.zyx.com.

Now lots of threads have internal links that are pointing to these non-existent addresses. I am looking for the quickest solution to update all internet link references from "all the other past URLs" to  forum.zyx.com.

I don't need a help with repair_settings.php and the likes as all directories/files are pointed correctly. My challenge is w/ the internal links.

PS: I normally use this plugin to fix similar challenges on WordPress, but haven't succeeded in finding a mod that would work like it.       

Kindred

There is no mod.

The only way to do what you are asking is to do a direct database update/replace of the smf_messages table, body column.  I think there is an external tool that someone wrote to do that... but it's a pretty straight forward sql query
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

panelpro

Quote from: Kindred on August 27, 2018, 09:09:44 PM
There is no mod.

The only way to do what you are asking is to do a direct database update/replace of the smf_messages table, body column.  I think there is an external tool that someone wrote to do that... but it's a pretty straight forward sql query

Thanks for your quick response sir. I'll appreciate a guide/pointer to any of these methods. As in - the exact codes/query to use for it.

vbgamer45

Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Illori

Quote from: shawnb61 on January 13, 2018, 09:35:23 PM
I have a utility that I use to setup test environments after restoring the DB from prod.  I got sick of clicking on a link in test & finding myself on my prod site. 

It does ***ALL*** paths ***AND*** URLs in the settings table, the themes table, the messages table, the PMs table & even member signatures (some folks on my forum actually promote their own "tips & tricks" threads in their signatures). 

It has a "do it" flag, which if set to "no" can be used to preview the changes. 

It is extremely helpful.  OTOH, it is extremely dangerous & should be used with extreme caution.  Uh... backup your DB first.   Then back it up again...   

I have it up on Github.  Link here:
https://github.com/sbulen/sjrbTools/blob/master/SMF_URLs_Paths.php


digger

Quote from: panelpro on August 27, 2018, 05:56:41 PM
I have this old forum that has undergone several URL changes over the years. From forum.xyz.com, to xyz.com/forum, to forum.zyx.com to zyx.com/forum and back to forum.zyx.com.

Now lots of threads have internal links that are pointing to these non-existent addresses. I am looking for the quickest solution to update all internet link references from "all the other past URLs" to  forum.zyx.com.

I don't need a help with repair_settings.php and the likes as all directories/files are pointed correctly. My challenge is w/ the internal links.

PS: I normally use this plugin to fix similar challenges on WordPress, but haven't succeeded in finding a mod that would work like it.     
The quickest solution is
Admin - Posts and Topics - Censored Words

panelpro

Quote from: Illori on August 28, 2018, 06:21:17 AM
Quote from: shawnb61 on January 13, 2018, 09:35:23 PM
I have a utility that I use to setup test environments after restoring the DB from prod.  I got sick of clicking on a link in test & finding myself on my prod site. 

It does ***ALL*** paths ***AND*** URLs in the settings table, the themes table, the messages table, the PMs table & even member signatures (some folks on my forum actually promote their own "tips & tricks" threads in their signatures). 

It has a "do it" flag, which if set to "no" can be used to preview the changes. 

It is extremely helpful.  OTOH, it is extremely dangerous & should be used with extreme caution.  Uh... backup your DB first.   Then back it up again...   

I have it up on Github.  Link here:
https://github.com/sbulen/sjrbTools/blob/master/SMF_URLs_Paths.php


Thanks for this sir. Looks like the exact thing I'm looking out for.

Kindred

digger... no

misusing the censored word list is the wrong way to handle this.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

panelpro

Hello,

Using this code UPDATE wp_posts SET guid = replace(guid, 'http://olddomain.com','http://newdomain.com'); as an example. Can you please give me the exact query code to run for:


  • smf_custom_actions
  • smf_messages
  • smf_settings
  • smf_personal_messages

Kindred

why would you need to do anything to custom_actions or settings?

don't touch settings. ever.

Anything you need to do with the settings table should be done in the admin interface or repair_settings.php

and regarding messages - the utility that illori pointed you to will do what you need.

but this is the command.
UPDATE smf_messages SET body = replace(body, 'http://olddomain.com','http://newdomain.com');
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

panelpro

Quote from: Kindred on August 28, 2018, 01:23:08 PM
why would you need to do anything to custom_actions or settings?

don't touch settings. ever.

Anything you need to do with the settings table should be done in the admin interface or repair_settings.php

and regarding messages - the utility that illori pointed you to will do what you need.

but this is the command.
UPDATE smf_messages SET body = replace(body, 'http://olddomain.com','http://newdomain.com');
Thanks so much for all your help sir. As for custom_actions, I created some pages (including privacy, terms, disclosure, et al) that have links pointing to the old domain. I can do the update manually (though) as it isn't as much as that of threads.

I ran the utility successfully, but the links (in threads) were not updated with the new domain. I'll try the code you suggested right away.

Thanks again for all your help   
   

panelpro

I've resolved to go the manual route. None of these worked for me.

Kindred

The above query did not work?

If not, then something is wrong with your setup, because I have used that same query 50 or more times myself on a dozen different hosts.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Shambles

Quote from: Kindred
UPDATE smf_messages SET body = replace(body, 'http://olddomain.com','http://newdomain.com');


Quote from: panelpro
I've resolved to go the manual route. None of these worked for me.


Give it another go, using Kindred's query with a bit added:


UPDATE smf_messages SET body = replace(body, 'http://olddomain.com','http://newdomain.com')
  WHERE body LIKE ('%http://olddomain.com%');

GigaWatt

Quote from: Kindred on August 28, 2018, 11:00:17 AM
digger... no

misusing the censored word list is the wrong way to handle this.

Exactly and I would also not recommend doing it.

BTW, did you try shawnb61's tool. I've used it a couple of times, it worked for me. Did you open up the php file in a text editor and read the instructions?
"This is really a generic concept about human thinking - when faced with large tasks we're naturally inclined to try to break them down into a bunch of smaller tasks that together make up the whole."

"A 500 error loosely translates to the webserver saying, "WTF?"..."

panelpro

Quote from: Sh@mbles on August 30, 2018, 02:44:58 PM
Quote from: Kindred
UPDATE smf_messages SET body = replace(body, 'http://olddomain.com','http://newdomain.com');


Quote from: panelpro
I've resolved to go the manual route. None of these worked for me.


Give it another go, using Kindred's query with a bit added:


UPDATE smf_messages SET body = replace(body, 'http://olddomain.com','http://newdomain.com')
  WHERE body LIKE ('%http://olddomain.com%');

Thanks a trillion times over sir. This worked like a breeze. Very much appreciated.   

Advertisement: