I just converted a SMF board (1.1.7) to IPB and there is some issues that I ran into that is worth to be shared.
If you have installed IPB you probably understand how the converter works. It’s a separate “app” that needs to be installed and the there is document to address how to use it. Basically on the admin converter page you are presented with several steps that need to be preformed, each one of them is specifically for converting some kind of data, such as “members”, “forums” etc. The problem I had was in the forum conversion step.
My original SMF board had a pretty simple forum structure: one main category, and a bunch of forums under it. It’s a pretty good mapping to IPB. However the converter refused to convert the sub forums, and only took the single top category in. Naturally not much information about this behavior can be found online because of the small user community of IPB, so I opened the converter code and took a peek.
Here is the problem I found:
Starting on line 608, in admin/applications_addon/ips/convert/modules_admin/board/smf_legacy.php file, is the code which loops through the existing forums and puts them into the new IPB database. The problem, as you can see in the code below, is that a “$loop” variable is built using the database result (fetched in the first while loop) but is never used later on. A few lines below, a second “fetch” is done in the second while loop to get the records. And based on my test, the second while loop never retrieves anything back.
$i = 1;
while ( $row = ipsRegistry::DB(‘hb’)->fetch() )
$records = $row;
$loop = $records;
while ( $row = ipsRegistry::DB(‘hb’)->fetch($this->lib->queryRes) )
I’m not sure the fact that the second while loop returning empty is the correct behavior of database API, or simply just a bug. But regardless of the reason, the first while loop to build the variable seems to be redundant and mostly likely was for the debugging purpose in the first place.
Once the cause was identified the issue was easy to fix. Just replace the second while loop with this:
foreach ($loop as $row)
Which basically use the previously built “$loop” variable for the cycle. And the SMP forums should be happily converted by IPB.
Keep in mind a lot can go wrong when converting boards between different software, especially from the one that has a lot of customizations. Hopefully this post provides some insight on troubleshooting the script.
The above issue is for IP.Board 3.0.5 only.