No announcement yet.

Updating old links directly in SQL?

  • Filter
  • Time
  • Show
Clear All
new posts

  • [Resolved] Updating old links directly in SQL?

    Hi all. Our web site has changed it's core domain name a few times over the last 20 years. I have a lot of posts that have links in them that link to old URLs. I've been testing some SQL queries on a test site, and these queries seem to work. When I visit the modified pages on my test site, the URLs look good and everything seems to work fine. So ultimately I'm asking if you can see any problems with this approach that I'm not seeing.

    One of the old URLs is Anything link that used to go to (no TLS) now needs to point to (new domain and TLS). So I run a query like this:

    update `text` set `rawtext` = REPLACE( `rawtext`, 'url=', 'url=' ) where`rawtext` like '%url=';

    I have a few other URLs like that that I also need to replace. I understand that directly editing the SQL is at my own risk and it's unsupported and usually a bad idea and all of that. Can you see any problems with doing this?

    Last edited by OldGrumpyDad; Mon 21 Sep '20, 2:04pm.

  • #2
    Untested queries can cause damage on a production server. Properly written and tested queries a very strong management tool. I don't see any problems with your specific query after testing.
    Translations provided by Google.

    Wayne Luke
    The Rabid Badger - a vBulletin Cloud demonstration site.
    vBulletin 5 API


    • #3
      I did it 6 months ago, and it changed all old domains to the new one. There is no problem to my knowledge.


      widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.