Fixed vBulletin 4.x with vBulletin Blog importer error

Academic

Member
Affected version
2.1.8 Patch 2
Hi!

When the import is done to the clean installation of XenForo, so by keeping the IDs, on the configuration step you are give an empty field to add the category name where the Blogs will be imported. And during the import this error is thrown and the import is interrupted:

In Entity.php line 1165:

[XF\PrintableException (parent_node_id)]
Please select a valid parent.

Exception trace:

at forumroot/src/XF/Mvc/Entity/Entity.php:1165
XF\Mvc\Entity\Entity->save() at forumroot/src/addons/XFI/Import/Importer/vBulletinBlogTrait.php:261
XFI\Import\Importer\vBulletin4WithBlog->getBlogsParentNodeId() at forumroot/src/addons/XFI/Import/Importer/vBulletinBlogTrait.php:306
XFI\Import\Importer\vBulletin4WithBlog->stepBlogEntries() at forumroot/src/XF/Import/Runner.php:231
XF\Import\Runner->runStep() at forumroot/src/XF/Import/Runner.php:59
XF\Import\Runner->run() at forumroot/src/XF/Import/Runner.php:151
XF\Import\Runner->runUntilCompleteInternal() at forumroot/src/XF/Import/Runner.php:128
XF\Import\Runner->runUntilComplete() at forumroot/src/XF/Cli/Command/Import.php:144
XF\Cli\Command\Import->execute() at forumroot/src/vendor/symfony/console/Command/Command.php:255
Symfony\Component\Console\Command\Command->run() at forumroot/src/vendor/symfony/console/Application.php:982
Symfony\Component\Console\Application->doRunCommand() at forumroot/src/vendor/symfony/console/Application.php:255
Symfony\Component\Console\Application->doRun() at forumroot/src/vendor/symfony/console/Application.php:148
Symfony\Component\Console\Application->run() at forumroot/src/XF/Cli/Runner.php:63
XF\Cli\Runner->run() at forumroot/cmd.php:15

The error is not thrown when you import to a board after adding a new node and when the IDs can not be kept.

The error is reproduced on 2 clean XenForo installations.

Thank you!
 
This not sounds like a bug but something you can fix by simply providing a parent node for the blogs. Make sure its not empty on settings screen
 
We've had the same problem. The Import process is losing the session information for the parent node.
I've added the last created category node id manually to the code as an ugly hard fix.
 
Last edited:
@Zambfd Can you share where did you add the code and which code? I will look into the code. Thanks!

Hi,

the importer created an empty category node (or many.. for each retry. They are called "Imported content"). I took the node id of the last one and put it at line 255 of \XFI\Import\Importer\vBulletinBlogTrait.php

PHP:
// $parentNode->parent_node_id = $this->getImportNodeParentId();
$parentNode->parent_node_id = 1234;

For some reason, the importer is losing the information in $this->session->extra['importContainerParentNodeId'] (getImportNodeParentId() in vBulletin.php), but only for the blog importing process.

Do not forget to restore the file when the blog steps are finished, or the filechecker will hate you. ^^
 
Last edited:
Thanks for the contributions guys. I've been itching to get switched over but I didn't really want to jump in knowing there was an issue ahead of me. Am I right in thinking that if I have never attempted the process before, I would create a new node and use it's ID in the provided code?
 
Hi,

the importer created an empty category node (or many.. for each retry. They are called "Imported content"). I took the node id of the last one and put it at line 255 of \XFI\Import\Importer\vBulletinBlogTrait.php
Where do you find the node id to continue with? I have the same issue with a large import from VB3.8
Thanks for the contributions guys. I've been itching to get switched over but I didn't really want to jump in knowing there was an issue ahead of me. Am I right in thinking that if I have never attempted the process before, I would create a new node and use it's ID in the provided code?
Can you let me know if you figure this out. I've left my migration too long and really need to get this done. ;)
 
I needed to get mine done too so I went ahead and tried with the above steps. It kinda worked but it kinda didn't. I have ended up with 1 forum node filled with all the blog posts+comments as threads+comments with no subforum nodes to contain the threads of each user named after and with permission for users to manage the forum. I started with a fresh XF installation and I nominated the default forum node named "Main forum". Perhaps that was my mistake. I got the node ID from the URL, to answer your question.
 
Last edited:
Hmm, I did it once before with our retaining the IDs and it worked. This time with them it died when trying to start step 23 (custom FAQ). Since I don't have many FAQ, skipping the import of that for me is fine. I'm not sure if this issue will come up just here or randomly the next time I try an import. I'm not sure if it is relevant, but I didn't have blogs in VBulletin and it the item above seems to reference blogs. I'm not sure if that is really relevant, but figured I'd ask.
 
FYI I did two subsequent imports that worked. The difference with these imports was I imported the custom FAQ pages as help pages and not Page Nodes.
 
After 2 test imports that basically worked, we went to do a live conversion yesterday today and included Blogs where we hadn't before. And it crapped out as per the above. Huge PITA. Now as far as the last comment about custom FAQ pages... for me Customer FAQ pages (we had none) were processed in step 23, and the import script died at the start of Step 27. Again.. I think the only thing I did was turn on Blog import.

Zambfd - will try your fix. Thank you for posting.

Step 25...
Step 26 of 31: Smillies [completed]
In Entity.php line 1165
Please select a valid parent
xf: import [--processese PROCESSES] [--finalize]

Update: I now just see this thread is titled about vBulletin 4.x imports. I experienced this problem with the blogs on a vBulletin 3.7/3.8 import.
 
Last edited:
Similar problem here from vB 4 to a clean Xenforo 2.1.10

Step 22 of 32: CAPTCHA Questions 00:00:00 [0]
In Entity.php line 1165:
Pease select a valid parent.

Thats a bit shocking after importing for over 15 hours. :oops:
 
Yea got it too vB4.2.5 -> 2.1.10 :rolleyes:

Traced it back to src/XF/Behavior/TreeStructured.php preSave() function and simply commented the error line out

Code:
                                $newParent = $entity->em()->find($entity->structure()->shortName, $parentId);
                                if (!$newParent || ($newParent->lft >= $entity->lft && $newParent->rgt <= $entity->rgt))
                                {
                                        ##$entity->error(\XF::phrase('please_select_valid_parent'), $this->config['parentField']);
                                }
The last comparison part in if fails, didn't look further since the migration proceeds just fine..
 
Last edited:
Yea got it too vB4.2.5 -> 2.1.10 :rolleyes:

Traced it back to src/XF/Behavior/TreeStructured.php preSave() function and simply commented the error line out

Code:
                                $newParent = $entity->em()->find($entity->structure()->shortName, $parentId);
                                if (!$newParent || ($newParent->lft >= $entity->lft && $newParent->rgt <= $entity->rgt))
                                {
                                        ##$entity->error(\XF::phrase('please_select_valid_parent'), $this->config['parentField']);
                                }
The last comparison part in if fails, didn't look further since the migration proceeds just fine..
FYI new migrated forum is up and running great :)

(to clarify, this was not the same parent_node_id undefined problem as mentioned before.. that part was fine in our install)
 
Last edited:
Top Bottom