Fixed Avatars not showing after import from VB 4.x

Steve8383

Member
I've just completed an import of Vbulletin 4 to XF 2. Everything seems to be ok, apart from all avatars are missing. The avatars were stored in the VB database.

Old avatar url:
/forum/image.php?u=348&dateline=1455220190

is replaced by:
<span class="avatar-u348-m">D</span>

How do I get the avatars to show up?
 
If the avatars were imported correctly, there should be no further work to do in order to have them appear - do you mean that they are not showing up next to peoples' posts, or in some other place? Can you see avatars for users you know should have avatars when your edit their user profile in the admin control panel?
 
I'm having a similar issue, vB4 (avatars stored in DB) to XF 2.0.4. I had previously tested importing to XF 1.5 and the avatars transferred without issue. Ended up waiting for XF 2 to be released and updated before migrating over to XF, and it seemed the importing process to XF1 was smoother than it is with XF2. There are over 22,000 users, most of which have avatars, this is what the importer showed for that step:

Importing...
Step 4 of 26: Avatars 00:00:00 [0] 5.02%
Step 4 of 26: Avatars 00:00:00 [0] 12.67%
Step 4 of 26: Avatars 00:00:01 [0] 21.97%
Step 4 of 26: Avatars 00:00:01 [0] 31.69%
Step 4 of 26: Avatars 00:00:02 [0] 43.02%
Step 4 of 26: Avatars 00:00:02 [0] 55.17%
Step 4 of 26: Avatars 00:00:03 [0] 69.86%
Step 4 of 26: Avatars 00:00:03 [0]

There are no avatars showing anywhere, even for users that definitely had avatars.

Jeff
 
While importing avatars, the importer skips users whose "avatarrevision" column has a value of 0. I think that shouldn't be the case if a user has a custom avatar. But maybe you could check that?

Something else that could have gone wrong: While configuring the importer, I think you'll have to leave the input field "Path to attachments directory" empty because otherwise the importer will only look in the filesystem and not in the DB.
 
I just checked the database, and all users have 'avatarrevision'=0 in the vB4 database. Additionally, I set/left the path to attachments directory, as all of the attachments are stored in the file system and not the database.

Not sure which of those may be causing the issue here, but the XF1 importer did manage to correctly import the avatars and the attachments correctly. I'm wondering if it may be a better option to import to XF1 and then upgrade to XF2.

Jeff
 
(In your previous post you wrote "avatars stored in DB" but now you say that they are stored in the filesystem? :))

Anyway, if all your users have avatarrevision=0 then problem definetely is that the avatar importer skips users with avatarrevision=0. You should be able to fix this issue by removing the following code from the "stepAvatars" method of the src/addons/XFI/Import/Importer/vBulletin.php file:

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

@Chris D I guess this code needs to be removed again from the importer. Not sure why some vB4 installations don't use avatarrevisions.
 
Oops, I should have read more carefully.

I should have written: "Something else that could have gone wrong: While configuring the importer, I think you'll have to leave the input field "Path to avatars directory" empty because otherwise the importer will only look in the filesystem and not in the DB."
 
Back
Top Bottom