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

XF 1.4 Import Attached Files Error

Lone Wolf

Well-known member
#1
I'm doing an XF 1.4.7 import from a 5 year old forum into a fresh 1.4.7 install. I've selected for imported content ID's to replace existing content IDs.

Everything has worked fine up till I tied to 'Import Attached Files' and then I keep getting this error...

Server Error

Mysqli statement execute error : Duplicate entry '1' 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/Importer/XenForo.php at line 2294
XenForo_Importer_XenForo->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 239
XenForo_ControllerAdmin_Import->_startStep() in XenForo/ControllerAdmin/Import.php at line 182
XenForo_ControllerAdmin_Import->actionStartStep() in XenForo/FrontController.php at line 347
XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 134
XenForo_FrontController->run() in /home/domain/public_html/admin.php at line 13
 

Lone Wolf

Well-known member
#5
Then you can't retain IDs as the IDs are already in use.
Did you mean destination forum instead of source forum?

The source forum is the forum with all the ID's and content, the destination forum is empty and the content is being imported into it.
 

Brogan

XenForo moderator
Staff member
#6
Yes, I meant destination.

A duplicate entry error shouldn't be thrown if there is no content at all.
Was there some content which was deleted?
 

Lone Wolf

Well-known member
#7
Yes, I meant destination.

A duplicate entry error shouldn't be thrown if there is no content at all.
Was there some content which was deleted?
No nothing. It was a completely fresh install of 1.4.7. I changed the favicon and logo-og files and added some styles folders.Do you think it might be one of those?
 

Lone Wolf

Well-known member
#8
So is there a way around this?

I allow attachments as part of my PC's and PC's are imported before attachments so could that be the reason?
 

Mike

XenForo developer
Staff member
#9
This shouldn't be related. In the destination forum, you can try emptying the xf_attachment and xf_attachment_data tables and then attempting to continue the import.
 

Lone Wolf

Well-known member
#10
Thanks Mike but I deleted everything and tried again. This time the attachments transferred without any problems.

I'll remember your advice about the attachment tables if it ever happens again.