XF 2.0 Script to fix imported posts with links?

Sabius

New member
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.
 

Sabius

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

Example URL from current board (SMF):

http://www.myforum.com/index.php?topic=1326.0

URL from converted Xenforo:

http://www.myforum.com/index.php?threads/maintenance-items-part-numbers-accessories.1326/

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.
 

Sabius

New member
Ok, I think I've figured this out. It is possible to just do /threads/[thread_id] and Xenforo will go to the correct thread.

Example using prior post:

http://myforum.com/index.php?threads/1326

That will get me to where I need. Now I just need to gracefully parse all threads somehow and make the link changes.
 

Sabius

New member
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.
 
Top