Not a bug Vbulletin 4 Import

AndrewSimm

Well-known member
Affected version
XF 2.0.1
Code:
Exception trace:
() at /home/xxx/public_html/preview/src/XF/Mvc/Entity/Entity.php:1083
XF\Mvc\Entity\Entity->save() at /home/xxx/public_html/preview/src/XF/Import/Data/AbstractData.php:234
XF\Import\Data\AbstractData->insertMasterPhrase() at /home/xxx/public_html/preview/src/XF/Import/Data/AbstractField.php:30
XF\Import\Data\AbstractField->postSave() at /home/xxx/public_html/preview/src/XF/Import/Data/AbstractData.php:135
XF\Import\Data\AbstractData->save() at /home/xxx/public_html/preview/src/XF/Import/Importer/vBulletin.php:793
XF\Import\Importer\vBulletin->stepUserFields() at /home/xxx/public_html/preview/src/XF/Import/Runner.php:160
XF\Import\Runner->runStep() at /home/xxx/public_html/preview/src/XF/Import/Runner.php:74
XF\Import\Runner->run() at /home/xxx/public_html/preview/src/XF/Cli/Command/Import.php:66
XF\Cli\Command\Import->execute() at /home/xxx/public_html/preview/src/vendor/symfony/console/Command/Command.php:242
Symfony\Component\Console\Command\Command->run() at /home/xxx/public_html/preview/src/vendor/symfony/console/Application.php:843
Symfony\Component\Console\Application->doRunCommand() at /home/xxx/public_html/preview/src/vendor/symfony/console/Application.php:194
Symfony\Component\Console\Application->doRun() at /home/xxx/public_html/preview/src/vendor/symfony/console/Application.php:117
Symfony\Component\Console\Application->run() at /home/xxx/public_html/preview/src/XF/Cli/Runner.php:63
XF\Cli\Runner->run() at /home/xxx/public_html/preview/cmd.php:15

xf:import

Code:
- Importing...
                                                                                     
  [XF\PrintableException]                                                            
  Phrase titles must be unique in a language. The specified phrase is already in use.
 
Just to confirm, this is definitely coming from XenForo 2.0.1, rather than 2.0.0? We fixed a similar issue with 2.0.0, so I am surprised to see it apparently cropping up in 2.0.1...
 
Just to confirm, this is definitely coming from XenForo 2.0.1, rather than 2.0.0? We fixed a similar issue with 2.0.0, so I am surprised to see it apparently cropping up in 2.0.1...

Yes, I tried this after upgrading to 2.0.1. I had the same issue with 2.0.0.
 
Do you have this code in your version of src/XF/Import/Importer/vBulletin.php?

PHP:
$existingFields = $this->getExistingUserFieldIds();
 
Would you run this query on your vB database and paste back the results please?
SQL:
SELECT pf.*,
	phr1.text AS title,
	phr2.text AS description
FROM profilefield AS pf
INNER JOIN phrase AS phr1
	ON(phr1.varname = CONCAT('field', pf.profilefieldid, '_title'))
INNER JOIN phrase AS phr2
	ON(phr2.varname = CONCAT('field', pf.profilefieldid, '_desc'))
 
Just in case you use a table prefix with your vB install, you'll need to alter the query as follows:

SELECT pf.*, phr1.text AS title, phr2.text AS description
FROM prefix_profilefield AS pf
INNER JOIN prefix_phrase AS phr1 ON (phr1.varname = CONCAT('field', pf.profilefieldid, '_title'))
INNER JOIN prefix_phrase AS phr2 ON (phr2.varname = CONCAT('field', pf.profilefieldid, '_desc'))
 
Alternatively, if you'd like to put in a support ticket including log in details for your database server, I could find out all the necessary info myself.
 
Would you run this query on your vB database and paste back the results please?
SQL:
SELECT pf.*,
    phr1.text AS title,
    phr2.text AS description
FROM profilefield AS pf
INNER JOIN phrase AS phr1
    ON(phr1.varname = CONCAT('field', pf.profilefieldid, '_title'))
INNER JOIN phrase AS phr2
    ON(phr2.varname = CONCAT('field', pf.profilefieldid, '_desc'))
Screen Shot 2017-12-23 at 9.09.05 AM.webp
 
Thanks for that @AndrewSimm - though I can't see anything there that immediately suggests why the problem would occur. Have you had this error thrown with multiple attempts at the import? Do you still get it if you start the import again from scratch (ie: restore your XF backup and start all over again)?
 
Thanks for that @AndrewSimm - though I can't see anything there that immediately suggests why the problem would occur. Have you had this error thrown with multiple attempts at the import? Do you still get it if you start the import again from scratch (ie: restore your XF backup and start all over again)?

Hi Kier, yes I have attempted the import multiple times. The first several attempts were with 2.0.0 and I made several attempts on 2.0.1. I've cancelled the import and retried several times as well. One thing to note is I am not attempting to keep id's. My goal of this import is to fill my test board with data from my live vb4 board.
 
Would you also dump the contents of your xf_user_field table so I can see what the data is being imported into?
 
I've just replicated your data in its entirety, and I don't get the same error, so I'm starting to wonder if maybe you have some stray phrases lying around that are causing the error...

Would you run the following query for me, on the DB before you start the import, please?
SQL:
SELECT * FROM xf_phrase WHERE title LIKE 'user_field%.%';
 
FWIW, this is roughly what you should expect to get after the import, if everything has gone to plan - note that the 'twitter' phrase from vB has been suffixed with '_2' so that it is unique in the DB:

1514322637316.webp
 
I've just replicated your data in its entirety, and I don't get the same error, so I'm starting to wonder if maybe you have some stray phrases lying around that are causing the error...

Would you run the following query for me, on the DB before you start the import, please?
SQL:
SELECT * FROM xf_phrase WHERE title LIKE 'user_field%.%';

Kier, one thing to note is I have tried the import a bunch of times on this database. Originally tried on 2.0.0 and now 2.0.1. Perhaps the orginal failure is causing the current?
Screen Shot 2017-12-26 at 4.51.37 PM.webp
 
If that data is from before you attempt the import, it is definitely the cause of the problem.

First, check that you dont have corresponding user fields, and delete them if you do, and then re-run that query and delete any phrases (via the ACP) that don’t correspond to user fields that should be there - ie Facebook and Skype, then the import should be fine.
 
I would hasten to say though, that as that data clearly came from an early import, it’s highly likely that you have other leftover data and you’re not running from a fully restored DB from before your import attempts - so try doing a full DB restore from a pre-import backup if you can.
 
I would hasten to say though, that as that data clearly came from an early import, it’s highly likely that you have other leftover data and you’re not running from a fully restored DB from before your import attempts - so try doing a full DB restore from a pre-import backup if you can.

Make sense, I will attempt that this weekend. I am sure it will work fine, so you can mark this as resolved.
 
Back
Top Bottom