1 (edited by fidel 2005-05-20 03:20)

Topic: phpBB->punBB polls not converting

trying to convert an oldish version of phpBB (2.0.4) forum to punBB 1.2.5. Everything goes fine until I hit the polls. PunPolls is installed and works when posting a new poll to a fresh punBB install.

What happened is, when the converter hits the section where it starts to convert the polls... it stops with a db error unknown field. The field names the converter is looking for in it's INSERT query are not in the pun_polls table.

I investigated further and checked out the converter file at converter package/PhpBB/polls.php and found this bit of code where it converts from phpbb and inserts into punBB:

        $todb = array(
            'id'                =>        $ob['vote_id'],
            'topic_id'        =>        $ob['topic_id'],
            'question'        =>        $ob['vote_text'],
            'answers'        =>        serialize($answers),
            'voters'            =>        implode(',', $voter_ids),
            'votes'            =>        implode('|', $results),
            'tot_votes'        =>        array_sum($results),
        );

        // Save data
        insertdata('polls', $todb);
    }

    convredirect('vote_id', $_SESSION['phpnuke'].'vote_desc', $last_id);

those field names do not match fields in pun_polls
topic_id should be pollid
questions is actually stored in pun_topics
answers should be options
tot_votes not present

so I changed some field names and got the data to insert (albeit, into incorrectly named fields) and then wrote an insert to move the question text to the corresponding pun_topic record. NO go... the options, voters and votes are not serializing correctly (from the code above, they apparently don't get serialized at all, however viewpoll.php expects them to be)??

So it kind of seems like this converter code wont do the job for me... any suggestions?

Re: phpBB->punBB polls not converting

your probably running 1.2.5 with EasyPoll not PunPoll, punpoll isn't up for download atm since it has some bugs i needed to sort out and easypoll seemed to be working fine.

3

Re: phpBB->punBB polls not converting

ah yes... sorry, it is Easy Poll, I miss stated. And it works just fine. Only problem is that the converter doesn't get the import from phpBB right... or maybe it's just that the phpBB version I'm working with is soooooooo old, or maybe it's not intended to work with Easy Poll??

I started putting together a script at the end of the night last night to try to correctly import the poll data from my version of phpBB. I got pretty close, but my poll options are still getting mixed up, which I can probably straighten out.

So at this point, I'll just continue on that path, unless anybody else has had similar issues importing polls from phpBB and knows of an easier fix?

and btw, excellent work on punBB. It's great to finally have a solid standards compliant forum option short of rolling your own. For the past year my forums have felt like an embarrassment to my website because of the junk code phpBB produces. I'm really looking forward to the punBB switch!

Re: phpBB->punBB polls not converting

yeh the convertor was never intended to work with easypoll

5

Re: phpBB->punBB polls not converting

So fidel... Did you (or anyone else) have any success with your script? I'm trying to get this to work also, but there's no point in "reinventing the wheel" if you've already done it. smile

6

Re: phpBB->punBB polls not converting

no... I never got the conversion script working properly. I believe there were two issues when I gave up work on it. The first was with getting the poll options associated to the correct poll. And the second was getting the votes per option to be correct. Easy poll expects that data to be a serialized string and I never worked out all of the kinks as far as automating the correct creation of those strings, so while the polls were correct, the specific votes and options were off. The rest of the conversion was pretty straight forward "read from this field, write to that field" migration... if any of that helps. I'll look and see if I kept the scripts I was working on.