Duplicate Successful import, no avatars

mazdas247

Member
I completed a successful import of 130k users, 300k threads and 5m posts in 16 hours from vBulletin 4. All is more or less good in the world, except zero avatars were imported. Avatars are stored in the vB 4 database, so I see no reason this should have failed.

I re-imported, this time only avatars. This re-imported the users (basically a no-op because the users already existed with same email addresses), and then it did the avatars but again grand total 0 avatars.

As soon as the post import rebuilding of the entire universe completes (HOURS) I will litter vBulletin.php with die() and various print() to see where is the fail. While I wait, I seek your help as to how to troubleshoot / fix this. I am on the latest release 2.0.5.
 
Okay, the code is just plain buggy, and assumes nobody stores avatars in DB. Here is the fix that works for me. I understand the code is beta, but this is pretty basic.

Diff:
diff --git a/htdocs/xenforo/src/addons/XFI/Import/Importer/vBulletin.php b/htdocs/xenforo/src/addons/XFI/Import/Importer/vBulletin.php
index 3ccc063..d41194f 100644
--- a/htdocs/xenforo/src/addons/XFI/Import/Importer/vBulletin.php
+++ b/htdocs/xenforo/src/addons/XFI/Import/Importer/vBulletin.php
@@ -1373,11 +1373,6 @@ class vBulletin extends AbstractForumImporter
                {
                        $state->startAfter = $userId;

-                       if (!$avatar['avatarrevision'])
-                       {
-                               // avatarrevision is used for file name so if it's empty skip this avatar
-                               continue;
-                       }

                        if (!$mappedUserId = $this->lookupId('user', $userId))
                        {
@@ -1387,6 +1382,12 @@ class vBulletin extends AbstractForumImporter

                        if (!empty($stepConfig['path']))
                        {
+                               if (!$avatar['avatarrevision'])
+                               {
+                                       // avatarrevision is used for file name so if it's empty skip this avatar
+                                       continue;
+                               }
+
                                // avatars stored as files
                                $avatarTempFile = $this->getAvatarFilePath($stepConfig['path'], $avatar);
 
Without your modifications, avatars in the DB were indeed missing.

With your code I was able to import avatars successfully.

Thanks for the fix,
-Markus
 
Okay, the code is just plain buggy, and assumes nobody stores avatars in DB. Here is the fix that works for me. I understand the code is beta, but this is pretty basic.
Clearly, that isn't the case. There's code to handle importing avatars from the database, so there was never an assumption that nobody does that. It was simply a misunderstanding of exactly what the value we were checking for did, and even so the issue was resolved a while ago. The fix will be in the next release.
 
Back
Top Bottom