1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.2 SMF internal links after migration

Discussion in 'Installation, Upgrade, and Import Support' started by shorepower, Jan 24, 2014.

  1. shorepower

    shorepower Active Member

    After migration there are some small errors we are trying to correct one by one. One of the errors is that several posts contains links to other posts and as a migration tool will not convert these links we planned to do it via an update in the database.

    To make it simple. Attached is two examples.

    and from
    Of course the key is the msg and post id's but as we changing directly in the database we would like to make sure that it's really an internal URL changing . Checking on "www.mydomain.com" is one possible idea. Anyone that could give and exempla on how the SQL to make these changes would look like?

    I found that the information is in table: xf_post and field:messages so the full link to the database would be:


    Thanks in advance
    Last edited: Jan 24, 2014
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Use this addon:


    Quick Find: [url=http://www.mydomain.com/vin

    Regular Expression: #\[url=http://www\.mydomain\.com/vin/[a-zA-Z0-9_\-]+/msg([0-9]+)/#msg[0-9]+\]([^\[]+)\[/url\]#siU

    Replacement String: [url=http://www.mydomain.com/goto/post?id=\1#post-\1]\2[/url]

    Quick Find: [url=http://www.mydomain.com/forum

    Regular Expression: #\[url=http://www\.mydomain\.com/forum/index\.php?topic=[0-9]+\.msg([0-9]+)#msg[0-9]+\]([^\[]+)\[/url\]#siU

    Replacement String: [url=http://www.mydomain.com/goto/post?id=\1#post-\1]http://www.mydomain.com/goto/post?id=\1#post-\1[/url]

    That should do it.
    shorepower likes this.
  3. shorepower

    shorepower Active Member

    Thanks @Jake Bunce. Worked perfect.

    Btw, really good add on, had not seen that. Allows you to change things even if you are not an sql-wizard.

Share This Page