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

Fixed Error importing from 2.0 Beta7 to 2.0 Beta7

Affected version
2.0 Beta 7

Jumuro

Active member
#1
I want to do a "clean upgrade".
Upgraded from xf1.5.15 to xf2.0.0 Beta7. Everything went fine.

Now I'm trying to do the import from xf2.0.0 Beta7 to xf2.0.0 Beta7.
Code:
LogicException: Column 'message' is required and has an empty value src/XF/Import/Data/EntityEmulator.php:160
Code:
Stack trace

#0 src/XF/Import/Data/EntityEmulator.php(198): XF\Import\Data\EntityEmulator->getWriteData()
#1 src/XF/Import/Data/AbstractEmulatedData.php(34): XF\Import\Data\EntityEmulator->insert(3979, Object(XF\Db\Mysqli\Adapter))
#2 src/XF/Import/Data/AbstractData.php(97): XF\Import\Data\AbstractEmulatedData->write(3979)
#3 src/XF/Import/Importer/XenForo2.php(1711): XF\Import\Data\AbstractData->save(3979)
#4 src/XF/Import/Runner.php(161): XF\Import\Importer\XenForo2->stepPosts(Object(XF\Import\StepState), Array, 8)
#5 src/XF/Import/Runner.php(75): XF\Import\Runner->runStep('posts', Object(XF\Import\StepState), 8)
#6 src/XF/Admin/Controller/Import.php(231): XF\Import\Runner->run()
#7 src/XF/Mvc/Dispatcher.php(249): XF\Admin\Controller\Import->actionRun(Object(XF\Mvc\ParameterBag))
#8 src/XF/Mvc/Dispatcher.php(88): XF\Mvc\Dispatcher->dispatchClass('XF:Import', 'Run', 'html', Object(XF\Mvc\ParameterBag), 'importData', Object(XF\Admin\Controller\Import), NULL)
#9 src/XF/Mvc/Dispatcher.php(41): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#10 src/XF/App.php(1844): XF\Mvc\Dispatcher->run()
#11 src/XF.php(328): XF\App->run()
#12 admin.php(13): XF::runApp('XF\\Admin\\App')
#13 {main}
Code:
Request state

array(4) {
  ["url"] => string(31) "/community/admin.php?import/run"
  ["referrer"] => string(55) "https://mytestdomain.com/community/admin.php?import/run"
  ["_GET"] => array(1) {
    ["import/run"] => string(0) ""
  }
  ["_POST"] => array(1) {
    ["_xfToken"] => string(8) "********"
  }
}
Discussions: 2000+
Messages: 40000+
Members: 10000+
php 7.1
 

Chris D

XenForo developer
Staff member
#2
Although we might be able to do more to skip over those posts I think the root cause might be that you have some posts that have no content.

Can you see what the result of the following query is?

SQL:
SELECT *
FROM xf_post
WHERE message = ''
 

Jumuro

Active member
#3
Although we might be able to do more to skip over those posts I think the root cause might be that you have some posts that have no content.

Can you see what the result of the following query is?

SQL:
SELECT *
FROM xf_post
WHERE message = ''
Yes, such messages exist.
Usually they only contain attachments.
 

Chris D

XenForo developer
Staff member
#4
So if you were to do:

UPDATE xf_post
SET message = 'Attachments:'
WHERE message = ''

That would update those empty messages so that they at least have “something” in there (you may wish to change the wording to suit your needs).

After that, the import should work fine.
 

Jumuro

Active member
#5
Yes, I already did that.
Just added special text, and then, after importing, again deleted it.

But it would be nice to consider this feature in future versions of import.
 

Mike

XenForo developer
Staff member
#6
This is fixed now. We will only throw this error in debug mode. This is mostly an error that's designed to aid with importer development to highlight areas where things may not be handled correctly. Otherwise we should bypass it and allow otherwise not-technically-valid data to be inserted and not block the import from continuing.