• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.4 phpBB import error

#1
I have just done and import from my phpbb forum to xenforo 1.4 using the import tool

its come up with this, any idea on the issue and how to fix it?

Server Error

Mysqli statement execute error : Duplicate entry '702' for key 'PRIMARY'

Zend_Db_Statement_Mysqli->_execute() in Zend/Db/Statement.php at line 297
Zend_Db_Statement->execute() in Zend/Db/Adapter/Abstract.php at line 479
Zend_Db_Adapter_Abstract->query() in Zend/Db/Adapter/Abstract.php at line 574
Zend_Db_Adapter_Abstract->insert() in XenForo/DataWriter.php at line 1624
XenForo_DataWriter->_insert() in XenForo/DataWriter.php at line 1613
XenForo_DataWriter->_save() in XenForo/DataWriter.php at line 1405
XenForo_DataWriter->save() in XenForo/Model/Import.php at line 1890
XenForo_Model_Import->importAttachment() in XenForo/Model/Import.php at line 1936
XenForo_Model_Import->importPostAttachment() in XenForo/Importer/PhpBb3.php at line 2089
XenForo_Importer_PhpBb3->stepAttachments() in XenForo/Importer/Abstract.php at line 97
XenForo_Importer_Abstract->runStep() in XenForo/ControllerAdmin/Import.php at line 187
XenForo_ControllerAdmin_Import->_runStep() in XenForo/ControllerAdmin/Import.php at line 135
XenForo_ControllerAdmin_Import->actionImport() in XenForo/FrontController.php at line 347
XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 134
XenForo_FrontController->run() in /homepages/1/d535499013/htdocs/vgforums/testsite/admin.php at line 13
 

Mike

XenForo developer
Staff member
#2
When this happens, it always seems to be the attachments step. I think it usually relates to a timeout happening and then the subsequent refresh failing.

To try to workaround it, you need to go into something like phpMyAdmin and into the xf_attachment table. Look for any entries with an attachment_id of 702 or greater and remove them. Then try to continue the import. Did that solve it?
 
#3
When this happens, it always seems to be the attachments step. I think it usually relates to a timeout happening and then the subsequent refresh failing.

To try to workaround it, you need to go into something like phpMyAdmin and into the xf_attachment table. Look for any entries with an attachment_id of 702 or greater and remove them. Then try to continue the import. Did that solve it?
Just tried this and came up with a fatal error page
Fatal error: Out of memory (allocated 82313216) (tried to allocate 9792 bytes) in /homepages/1/d535499013/htdocs/vgforums/testsite/library/XenForo/Image/Gd.php on line 215
 

Mike

XenForo developer
Staff member
#4
Right, that's likely what happened before or similar. You're likely to have to repeat the process I explained above to continue, in addition to adding the following to config.php:
Code:
$config['maxImageResizePixelCount'] = 10000000;
Your server doesn't seem to allow you to use the full PHP memory_limit value and thumbnailing large images needs a large amount of memory. That line will prevent thumbnailing for images that are larger than ~10 megapixels (the default is 20 megapixels).

Apply that change and refresh the import; you'll probably get the duplicate ID error, so you'll have to repeat that step. You should be able to continue after that. If you get an out of memory error again, you can reduce the value of that config.php line further.
 
#7
That worked a treat guys thank you, had to change it to this for it to run through tho

Code:
$config['maxImageResizePixelCount'] = 5000000;