Conversion problems with IPB 2.1.7 board

Started by ArchVile, March 19, 2015, 12:53:09 PM

Previous topic - Next topic

ArchVile

I have a forum which runs IPB 2.1.7 and am trying to convert it to SMF 2.0.9. I began first by following the suggested instructions of going to the downloads section and getting the appropriate converter for my version of IPB (2.1.7) - smf_2-0_invision21_converter.zip. I ran into a lot of issues of it failing in successive areas of the conversion process, searched on the forums here and found the fixes for the various problems, which were related to things like null integer values in returned sql query rows (suggested fix to use IFNULL()), typos in sql queries, and empty values in rows (suggested fix to use empty() function).

It has now finished the conversion process (with a lot of warnings along the way with undefined variables and such), but I've run into problems with the end result. The first being the password for my forum account is no longer valid on the SMF version, so I can't login. I assume this means none of the members on my forum will be able to login either. The second major issue is all attachments have been broken on the board. The only thing that shows up in posts that had attachments are the old IPB bb code "[attachmentid=815]" as an example. The third problem is that the statistics say there is only one member on the board, which links to the old default SMF admin account which was wiped by the conversion script. Also, none of the warning histories for members on the IPB board were converted to SMF.

I am not sure the best way to proceed from here. As I have a very old version of IPB it seems the conversion script for it isn't being actively developed anymore (the sticky thread was last active in January 2010). I can attempt to upgrade my site from IPB 2.1.7 to 3.4.7, but that is a major undertaking which I've been avoiding so far, I don't want to mess up the production version of my forums.

margarett

Hi and welcome to sm.org ;)

I'll reply properly later. But your converter needs for sure some "manual" work.
We'll get through it ;)
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

ArchVile

Thanks!

I wiped the converted installation out and started over with SMF 2.0.9 so it's set for another attempt.

margarett

Hi there.

Now with a bit more time ;)

QuoteThe first being the password for my forum account is no longer valid on the SMF version, so I can't login
This is unfortunately true for most conversions... Passwords aren't converted (because they can't be, salted passwords can't be retrieved), they are just copied over. SMF doesn't know IPB's encryption method so it doesn't work after conversion :(

QuoteI assume this means none of the members on my forum will be able to login either.
Yes, everyone needs to reset his password...

QuoteThe second major issue is all attachments have been broken on the board. The only thing that shows up in posts that had attachments are the old IPB bb code "[attachmentid=815]" as an example
This is the biggest problem to solve, unfortunately. SMF doesn't support inline attachments and, even adding the MOD that supports them, the numbering is different. We would need to:
a) modify the converter to store the "old" attachment ID from IPB in SMF's table
b) write a script that scans the database for a certain string pattern, fetches the old ID out of it, gets the new ID from the old one and finally write a IMG BBC for SMF to show it. Doable, but not for the fainted heart ;D

QuoteThe third problem is that the statistics say there is only one member on the board, which links to the old default SMF admin account which was wiped by the conversion script
Go to your ACP, Maintenance and perform the routines "Fix and repair errors" and "Recount all totals" ;)

QuoteAlso, none of the warning histories for members on the IPB board were converted to SMF
I have no idea what you're talking about :P but I assume that no, it wasn't converted... The parts that the convert deals with are identified in the .sql file, eg:
/******************************************************************************/
--- Converting members...
/******************************************************************************/

That's not something that I have ever seen someone requesting before...

QuoteI don't want to mess up the production version of my forums.
You shouldn't mess with it, really. Good move ;)
This should take you there. I hope :P
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

ArchVile

Quote from: margarett on March 19, 2015, 09:07:30 PM
Hi there.

Now with a bit more time ;)

This is unfortunately true for most conversions... Passwords aren't converted (because they can't be, salted passwords can't be retrieved), they are just copied over. SMF doesn't know IPB's encryption method so it doesn't work after conversion :(
Yes, I guess this makes sense, the SMF source would need to be modified to hash the passwords the same way as IPB does, probably not worth the trouble.

Quote from: margarett on March 19, 2015, 09:07:30 PMThis is the biggest problem to solve, unfortunately. SMF doesn't support inline attachments and, even adding the MOD that supports them, the numbering is different. We would need to:
a) modify the converter to store the "old" attachment ID from IPB in SMF's table
b) write a script that scans the database for a certain string pattern, fetches the old ID out of it, gets the new ID from the old one and finally write a IMG BBC for SMF to show it. Doable, but not for the fainted heart ;D
Yea, unfortunately the forum relies heavily on attachments, mostly file downloads, inline images aren't as important but it would be nice to keep them as well. It would be a ton of work to repost all the file download attachments from scratch. In regards to mods, it looks like SMF would need two to recreate all the IPB functionality needed: The attachment one you reference, and the forum views one.

Quote from: margarett on March 19, 2015, 09:07:30 PMGo to your ACP, Maintenance and perform the routines "Fix and repair errors" and "Recount all totals" ;)
Thanks, I'll give that a try if I can get everything else converted over successfully.

Quote from: margarett on March 19, 2015, 09:07:30 PMI have no idea what you're talking about :P but I assume that no, it wasn't converted... The parts that the convert deals with are identified in the .sql file, eg:
/******************************************************************************/
--- Converting members...
/******************************************************************************/

That's not something that I have ever seen someone requesting before...
Yea, unfortunately some members caused lots of problems in the past, accruing many warnings. We were too lenient in handling it (they'd have gotten banned most places), and revised our policies since then, so we'd like to preserve the warning logs in case the instigators act up again in the future.

margarett

Starting on the easy part :P

QuoteYea, unfortunately the forum relies heavily on attachments, mostly file downloads, inline images aren't as important but it would be nice to keep them as well. It would be a ton of work to repost all the file download attachments from scratch. In regards to mods, it looks like SMF would need two to recreate all the IPB functionality needed: The attachment one you reference, and the forum views one.
Attachment *MUST* be converted, if not there's something wrong with the converter or the environment (eg: wrong permissions in "attachments" folder). Inline images would require some manual labor but the attachments being there *absolutely* must work...
Maybe it has to do with the warnings you had about undefined variables and stuff? I would have to see to be sure...

About the password: if I knew how IPB hashes the password, it is probably possible to have SMF to recognize it (with a modification to LogInOut.php). Only if I could test it, though...

The warning logs... My oh my :P That would require to write a new converter step for it. Do note that, probably, the converter for the newer versions also doesn't handle that. As I told you, it's the first time that I've seen such request. It is doable but I'm really busy these days :( And, TBH, I wouldn't like to invest much time in such ancient converter :(
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

ArchVile

I reran the converter and the file attachments still weren't working, so I went into attachment maintenance and did some of the repair options there and it fixed them all. Everything shows up now, even images, they aren't inline but it's a lot better than losing them completely.

When I went into the maintenance to recount everything it found thousands upon thousands of errors, but said it fixed all of them. The statistics are also correct now.

PMs didn't make it over for some reason, so I looked in the database and saw the deleted flag was set to 1 for all of them. Once I updated that to 0, they show up now.

I see that like IPB there is an option to set a color for member groups, but this color only seems to apply for the online now list, and not in profiles and posts. I guess a mod is needed for that functionality.

From my research, it appears SMF uses SHA to hash. IPB 2 used MD5. Since hashes are supposed to be one way functions I don't think there's any way around all the members having to reset their passwords, unfortunately. Also, MD5 was compromised so it's probably not a good idea to modify SMF to use MD5 instead of SHA.

I am looking into the warnings stuff still, I might possibly be able to get them transferred over with a couple SQL queries. If that works I'll post how here. Thanks for your assistance so far.

ArchVile

Just for anyone else who's attempting a conversion from 2.1.7, I ran into some gotchas along the way. Some of these were difficult to track down.

First major one was the SMF permissions tables got corrupted in a way that allowed guests and other member groups to have permissions that could not be disabled through the admin panel at all. I had to debug the smf php code to find out where it was happening. Somehow the smf_permissions table got populated with values that should only be in smf_board_permissions. Such as: post_new, post_reply_any, post_reply_own. Since SMF joins the two tables in one array when checking permissions, even if the said permission wasn't in smf_board_permissions it would still let the membergroup have that permission. I had to go into the database and manually remove these errant entries from smf_permissions.

The second problem was with member IP addresses. In the smf_members table, converted members columns member_ip and member_ip2 weren't populated. This caused a search for every single IP that ever posted to the board which was then listed on the track user page. A quick (but somewhat inaccurate) fix is to populate both these columns with the ibf_members.ip_address value, this at least prevents it from searching all IPs that ever posted to your board, and will be updated to the correct values the next time the member uses the forum. The accurate way to do it would be to write an SQL query that obtains the member's IP from their most recent post on the IPB board, and if they have no posts, use the one from ibf_members.ip_address.

I was able to fix the password hash issue. SMF does have code in its login handler which will convert an IPB 2 hash to the correct SMF one automatically. The reason this was not working for certain members was because some characters in the IPB salt were being escaped when they were transferred over to the SMF database. Once I figured that out and fixed the salts to match the original IPB ones, everyone was able to login fine.

That is everything I can recall right now since I did the conversion over a month ago. I did get warnings converted over but my sql query to do that was lost when the power went out. I will see if I can recreate that to share here, it wasn't all sql though, it required dumping query results to files for programmatic regex replacing.

margarett

Many, many thanks for tracking all those issues ;)
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Advertisement: