XF 1.5 IPB 3.4.7 import to Xenforo 1.5.24 - Polls section

FidoMike

Member
Hello,
I am having an issue with the importer, I get the following error:

polls-error.webp

I found various other threads regarding issues with polls, but when looking in the files where a fix is suggested, the line numbers are very different, therefore I didn't want to change things as it was likely for an older version. Closest I found was this " Import from IPB3.3, error on Polls" note I'm using 3.4.7, and the 3.4.x import tool. It seems to do most of the polls, if its just one I'd happily skip it or blank it in the source DB if needed.

I tried the items which follow the polls on a re-attempt and it works fine, so looks like just this one area.

Really appreciate any help on this,
Thanks,
Mike.
 
Solution
It might be, I'm trying to check but not having much luck finding that out from the db, they all seem to have unique pid and tid numbers, which I'm thinking might be poll and topic id. Ok I found something, the same question 2 times with same tid but different pid. Looking at the thread in ipb, I only see 1 poll there. I wonder if this is confusing the importer, as I suspect it will try to make 2 polls in the same thread.

Edit
Ok that wasn't it, but I did find the problem. A poll with no questions. I'm also stumped as to how someone managed to record a vote on it as well.

Anyway, in the unlikely event someone else has bad users, here is what I did to find it:
Open up
library/XenForo/Importer/Abstract.php
go to line 204 and add...
It might be, I'm trying to check but not having much luck finding that out from the db, they all seem to have unique pid and tid numbers, which I'm thinking might be poll and topic id. Ok I found something, the same question 2 times with same tid but different pid. Looking at the thread in ipb, I only see 1 poll there. I wonder if this is confusing the importer, as I suspect it will try to make 2 polls in the same thread.

Edit
Ok that wasn't it, but I did find the problem. A poll with no questions. I'm also stumped as to how someone managed to record a vote on it as well.

Anyway, in the unlikely event someone else has bad users, here is what I did to find it:
Open up
library/XenForo/Importer/Abstract.php
go to line 204 and add in the part in red:

protected function _convertToUtf8($string, $entities = null)
{
// note: assumes charset is ascii compatible
print_r($string);
if (preg_match('/[\x80-\xff]/', $string))
{
$newString = false;
if (function_exists('iconv'))


Now go back to the browser with the error showing, click the "import external data" breadcrumb in the top navigation, when it prompts you, press 'continue import'. It will now give you the error again, but splatted at the top of the screen will be all the polls it was trying to process in order. Look at the last one, that is the problem poll. Obviously if you have thousands or more polls, that might not be the best option, but I only had 292.

I would suggest that once you have fixed that poll, remove the line that was added, or you will get loads of data dumped into your browser.
 
Last edited:
Solution
The import tool does ask to choose between taking the 'first question' or 'the last question' before it starts the import, but its not per poll, so somewhat random effect on the poll depending on if the creator put the important question first or last.
 
Back
Top Bottom