Fixed Importing from VB5 error

keith455

New member
I received this message when trying to import my VB5 DB. i'm running the XF2.0.1
"Phrase group titles must be no more than 50 characters."
I went to my groups and none of them are over 50 characters.
also where is the import log kept?
 
The import log is kept in the table you specified when you selected which steps you wanted to run, before starting the import process - it’s just a record of content imported and the corresponding id in the new XenForo DB.

Which step was running when you got the error?
 
i ran the cli importer at the command line.
php cmd.php xf:import
Starting import from vBulletin 5.x (Beta)...
- Step 1 of 26: User groups 00:00:00 [27]
- Step 2 of 26: Custom user fields 00:00:00 [18]
- Step 3 of 26: Users 00:00:32 [12,341]
- Step 4 of 26: Avatars 00:01:22 [1,692]
- Step 5 of 26: Buddy and ignore lists 00:00:03 [1,209]
- Step 6 of 26: Paid subscriptions 00:00:00 [5]


[XF\PrintableException]
Phrase group titles must be no more than 50 characters.


xf:import
 
If you're on the CLI, try running php cmd.php xf:import -verbose to get a full error trace, then paste the error back here.
 
retain ids is not checked.
Code:
 php cmd.php xf:import -verbose
The "-e" option does not exist.
sytynet@syty.net [~/www/community]# php cmd.php xf:import -v
Starting import from vBulletin 5.x (Beta)...
 - Step  1 of 26: User groups               00:00:00 [27] (< 1 sec)
 - Step  2 of 26: Custom user fields        00:00:01 [18] (< 1 sec)
 - Step  3 of 26: Users                     00:00:35 [12,341] (33 secs)
 - Step  4 of 26: Avatars                   00:01:25 [1,692] (1 min)
 - Step  5 of 26: Buddy and ignore lists    00:00:03 [1,209] (2 secs)
 - Step  6 of 26: Paid subscriptions        00:00:00 [5] (< 1 sec)


  [XF\PrintableException]
  Phrase group titles must be no more than 50 characters.


Exception trace:
 () at /home/sytynet/public_html/community/src/XF/Mvc/Entity/Entity.php:1083
 XF\Mvc\Entity\Entity->save() at /home/sytynet/public_html/community/src/XF/Import/Data/AbstractData.php:234
 XF\Import\Data\AbstractData->insertMasterPhrase() at /home/sytynet/public_html/community/src/XF/Import/Data/BbCode.php:36
 XF\Import\Data\BbCode->postSave() at /home/sytynet/public_html/community/src/XF/Import/Data/AbstractData.php:135
 XF\Import\Data\AbstractData->save() at /home/sytynet/public_html/community/src/XF/Import/Importer/vBulletin.php:1672
 XF\Import\Importer\vBulletin->stepCustomBbCodes() at /home/sytynet/public_html/community/src/XF/Import/Runner.php:160
 XF\Import\Runner->runStep() at /home/sytynet/public_html/community/src/XF/Import/Runner.php:74
 XF\Import\Runner->run() at /home/sytynet/public_html/community/src/XF/Cli/Command/Import.php:66
 XF\Cli\Command\Import->execute() at /home/sytynet/public_html/community/src/vendor/symfony/console/Command/Command.php:242
 Symfony\Component\Console\Command\Command->run() at /home/sytynet/public_html/community/src/vendor/symfony/console/Application.php:843
 Symfony\Component\Console\Application->doRunCommand() at /home/sytynet/public_html/community/src/vendor/symfony/console/Application.php:194
 Symfony\Component\Console\Application->doRun() at /home/sytynet/public_html/community/src/vendor/symfony/console/Application.php:117
 Symfony\Component\Console\Application->run() at /home/sytynet/public_html/community/src/XF/Cli/Runner.php:63
 XF\Cli\Runner->run() at /home/sytynet/public_html/community/cmd.php:15

xf:import
 
I don't think that this is going to make a difference, but before I dig into the code, could you try adding a line of code and running again to see if it changes the outcome?

src/XF/Import/Importer/vBulletin.php

Find:
PHP:
                /** \XF\Import\Data\UserUpgrade $import */
                $import = $this->newHandler('XF:UserUpgrade');
                $import->bulkSet($data);
and replace with
PHP:
                /** \XF\Import\Data\UserUpgrade $import */
                $import = $this->newHandler('XF:UserUpgrade');
                $import->preventRetainIds();
                $import->bulkSet($data);
 
I ran into the same problem with the VB4 importer. It is because of whitespaces in custom bbcodes e.g. [my bbcode]

src/XF/Entity/Phrase.php
PHP:
protected function verifyTitle($title)
{
    if (strpos($title, '.') !== false)
    {
        if (sizeof(explode('.', $title)) > 2)
        {
            $this->error(\XF::phrase('phrase_titles_may_only_contain_single_dot_character'));
            return false;
        }
        else if (!preg_match('/^[a-z0-9_]{1,50}\.[a-z0-9_]+$/i', $title))
        {
            $this->error(\XF::phrase('phrase_group_titles_must_be_no_more_than_50_characters'), 'title');
            return false;
        }
    }

    return true;
}

The regex does not allow whitespaces. custom_bb_code_title.my bbcode
 
It looks like there are a number of separate issues here, so I’m moving this thread to the bugs forum
 
To do:
  1. Skip illegal BB codes (contain spaces etc.)
  2. Work out how the phrase title for paid subs ends up with > 50 chars
 
Fixed - by adding this check to the bbcode importer at the beginning of foreach ($bbCodeTags...:
PHP:
        foreach ($bbCodeTags AS $tag => $bbCodes)
        {
            if (!preg_match('/^\w{1,25}$/', $tag))
            {
                // can't import illegal tags, so skip
                continue;
            }

            if ($existingRules->getTag(strtolower($tag)))
            {
                // we already have a bbCode tag with that tag name, so skip it.
                continue;
            }
 
I made the change to the src/XF/Import/Importer/vBulletin.php file and now i'm getting this error
Code:
 Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 72 bytes) in /home/sytynet/public_html/community/src/XF/Import/Importer/vBulletin5.php on line 148
 
I made the change to the src/XF/Import/Importer/vBulletin.php file and now i'm getting this error
Code:
 Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 72 bytes) in /home/sytynet/public_html/community/src/XF/Import/Importer/vBulletin5.php on line 148
Was there a full error trace with that error?
 
Top Bottom