XF 2.0 Script to fix imported posts with links?


Is there a script available to parse all posts, and convert any links to forum posts to the new Xenforo format?

I converted from SMF 2.0 and I have many posts that had links to other posts, and now those links are broken. They need to be converted to the new Xenforo URL format.


Let me give more detail on what I mean by this.

Example URL from current board (SMF):


URL from converted Xenforo:


So as you see, the converted URL has the thread title in it. Is there a shortcut for a Xenforo URL to access with just the topic id like in SMF? If so, I'd need to find a way to parse my topics/posts and convert the SMF URLs to the short Xenforo format if it exists.

Has nobody had this issue before? I have links to other posts all over my forum. Big issue with the converted content.


This is what you are looking for: https://xenforo.com/community/resources/post-content-find-replace.5748/

I hope you've got good Regex chops!

Refer to the v1.x version for documentation: https://xenforo.com/community/resources/post-content-find-replace.1549/

Alternatively, look at hand-coding some redirect scripts which make those old URLs valid and redirect to XF URLs - then you don't need to fix the old links.

This looks like what I need. Unfortunately, I don't know a damn about regular expressions. I'll figure it out in time I guess... Thanks for pointing this out.