Simple Machines Community Forum

SMF Support => Converting to SMF => phpBB => Topic started by: Rk2910 on April 01, 2015, 05:37:27 AM

Title: Converting links in old topics - how many levels should be auto converted?
Post by: Rk2910 on April 01, 2015, 05:37:27 AM
When I converted from phpbb to smf most of our links that a member embeds in a post, to another topic on our site are updated to the equivalent smf topic but some buried 2 topics down are not.  Ex: I post a link to direct a member to go look at another topic for reference.  It works as expected and if it was an old post when I converted, was converted. That old topic has a link that refers to another topic - those are not converted, the link takes them back to our old site which I would like to delete one day.  We typically find these unconverted links in very old posts. Is there a way to rerun something that will convert everything?  It's very painful to do this manually.

Title: Re: Converting links in old topics - how many levels should be auto converted?
Post by: margarett on April 01, 2015, 07:18:50 AM
It didn't "convert" links ;)

What happens is that any topic, be it old or new, has a unique ID. While SMF and phpBB have different ways to handle the links to topics/posts, when the software is running, you can always link to any existing topic/post, no matter if it was created before or after the conversion, because all it matters is its ID.
Even the very first topic that your phpBB setup had (eg, "Welcome to phpBB", topic ID = 1), SMF can handle it because it links to its ID and *not* to how it was created.

Topic links in posts, on the other hand, are not converted because they are just that, links.
A link inside the post to http://www.simplemachines.org/community/index.php?topic=535221.0 is not different from a link to http://www.google.pt
So when you convert, well, the posts content isn't changed. That's why your old posts to old links fail, because they are just text inside a post (which, incidentally, SMF parses as a link but, in the database where it matters, they are just text).

The only possibility is to build a custom script that checks all your forum posts, looks for the "old pattern" of phpBB, extracts IDs and replaces all of that with a valid link in SMF format (eg: www.forum.com/index.php?topic=xxxxxxx)
Title: Re: Converting links in old topics - how many levels should be auto converted?
Post by: Rk2910 on April 02, 2015, 07:53:08 PM
Ahh, so this is where my thread ended up.  I posted it over on 2.0 support and someone moved it without leaving a link.  I couldn't find it.  Sorry I double posted - I knew I posted it but couldn't find it anymore.

Thanks for the reply Bruno - doesn't sound like it is going to be fun.  Have you seen an existing mod that does this?
Title: Re: Converting links in old topics - how many levels should be auto converted?
Post by: margarett on April 02, 2015, 08:01:10 PM
There is no mod because it's always a custom "thing". I did something similar for another forum some time ago and it wasn't funny at all :(

I can take a peek at this in the next days. If you can link me a topic where this happens, that would help ;)
Title: Re: Converting links in old topics - how many levels should be auto converted?
Post by: Rk2910 on April 03, 2015, 06:09:01 AM
When we run into one again I'll save it and post it here for you.  Thanks Bruno.
Title: Re: Converting links in old topics - how many levels should be auto converted?
Post by: Rk2910 on April 03, 2015, 08:48:57 PM
It didn't take long to run into one  O:)
The problem is as a regular user and you click on the link, there is a redirect to the new site so you can't get to the old site. Hmmm.  Have to figure this part out.
Title: Re: Converting links in old topics - how many levels should be auto converted?
Post by: margarett on April 04, 2015, 05:00:39 PM
Can we get that post?
Title: Re: Converting links in old topics - how many levels should be auto converted?
Post by: Rk2910 on April 06, 2015, 05:44:38 AM
Here it is.  Look at the post made by Pete and it has a link to the old site in it.
http://classicaquasport.com/smf/index.php?topic=8650.msg71897#msg71897
Title: Re: Converting links in old topics - how many levels should be auto converted?
Post by: margarett on April 07, 2015, 10:15:49 AM
OK, in this case I think it's really better to create a "fake" viewtopic.php that picks the requested topic ID + message ID and redirects it to the proper SMF post.
It's easier than to "hammer" the complete database (because the links can pretty much vary)

In that case, you would need to remove phpBB's "viewtopic.php" (rename it to something else, maybe) and put that new script in its place.

Regarding the link you pointed out: viewtopic.php?f=8&t=7552
Do you know what's that f=8? t=7552 is the topic number but I don't really understand what's the f=8 ???