Resource icon

vBulletin 5 to Xenforo Importer 1.1.414.1

No permission to download
I have a problem with importing members - I'm stuck at usernames with ",(comma)" in it...is there a way to ignore this and import this users anyway or I must skip this users like the ones with @ in usernames?

In doing mine Martijn, I didn't find a way around it. I had to go into my vb5 install and manually correct usernames with commas and ampersands before doing the import. Thankfully I didn't have too many.
 
I don't think Xenforo allows the , comma.
If you make it that new members are allowed to use comma in their name in Xenforo. The importer will allow the comma as well. I'm uncertain this is even possible.
Hrm.. Usernames must be unique. Did you restart the members section or did you just refresh and continue?
If you start the members from scratch again, should be ok (It will delete them all and restart).
 
I recommend doing something like what Lloyd Barron did. Otherwise you'll have threads, and posts that are either dropped or have no valid poster.
Then just send an email to the member saying, "Because of new system we had to change your name to X, if you'd like it to be something else please let us know and we will work with you to rename your account."
Fortunately I blocked all those types of names in the beginning.
 
I don't think Xenforo allows the , comma.
If you make it that new members are allowed to use comma in their name in Xenforo. The importer will allow the comma as well. I'm uncertain this is even possible.
Hrm.. Usernames must be unique. Did you restart the members section or did you just refresh and continue?
If you start the members from scratch again, should be ok (It will delete them all and restart).

I did look up in the xenforo registration option but there is no option to allow special characters so I guess only solution is to skip that users.
I did try to refresh and to start all over but I still get error.

This is the error: Uncaught exception 'XenForo_Exception' with message 'User names must be unique. The specified user name is already in use.'

It stops at cycle 8 of 27 (if this helps)
 
Only thing I can think of is that you have a user that has the same name as someone else. Just that its upper or lower case sensitive where Xenforo is not.
UserName and username are treated the same.
There are 2 ways you can fix it from what I can see.
1 - You might be able to fix this with changing the databases coalition. If your using UTF-8 for example you can switch to utf8_bin.
When the database is searching UserName is not the same as username anymore. I'm not sure entirely if Xenforo's code would by-pass this and change it to all lower case on a search anyways.
2- If you go into xf_user and look at the last member in the table. This will be the member just before the error. This will allow you to see what the name of the member is. Then search in Xenforo for that user name ans see what the conflict is. From there you can make a decision.

Else you can try this.
Where it says // save user
Change
$writer->save();
$userId = $writer->get('user_id');

to:
if ($writer->save()){
$userId = $writer->get('user_id');
}else{
continue;
}

This should skip that user, and any other users it errors on. I haven't tested it.
 
As for Attachments. You shouldn't have needed to change any of the information in the attachments stuff. If you did. I recommend changing it back, unless you changed it all internally for Xenforo as well. I'll take a look but its working on my end.

I did some further investigating into this and found a couple of things. First, the main error was coming up because the target directory in the Xenforo filesystem didn't exist by default. After creating that, the mkdir error went away. Also had to do this for smilies, just fyi. Probably XF doesn't create that particular directory in a fresh install.

However, I'm still not importing attachments, and I think I see why. I think the importer is looking for them in the physical directory structure of vb5, but by default those attachments are all stored within the database itself. If I'm right, would there be a way to change the import to look there instead?
 
Ahh you have them in the DB. I should see if I can figure out a way to check for that. You can export them to be in a file system from in the admincp options.
I currently, don't know of a way to export them from the DB. Might be able to change the filedata to point to the DB instead of a directory. But not entirely sure where its stored either.
 
Last edited:
1 - You might be able to fix this with changing the databases coalition. If your using UTF-8 for example you can switch to utf8_bin.
When the database is searching UserName is not the same as username anymore. I'm not sure entirely if Xenforo's code would by-pass this and change it to all lower case on a search anyways.
2- If you go into xf_user and look at the last member in the table. This will be the member just before the error. This will allow you to see what the name of the member is. Then search in Xenforo for that user name ans see what the conflict is. From there you can make a decision.

1. Where can I change collation? I use utf8_general_ci on both databases, vB and xenforo
2. I did look at the last member and I search in xf_user for that username but there is only one member with that username, email of that user is also unique. Could custom title cause this problem?
 
1. if you have Phpmyadmin you can Goto PhpMyAdmin->Operations->Collation. else, I really recommend looking up on google how to do it that works for you.
2. I may not have made myself clear. Let me try to explain better.
In xf_user. You will see the last user_id = X
Go to your VB5 users table. Look at userid X and then look at the one right after it. Its the one that is the problem. I'm willing to bet, that the username found there. Exists in xf_user. But earlier on. You should be able to see in the VB5 users table the two names.
 
I'm not certain that #1 will fix your issue Martijn. If your first DB is set at general_ci than there shouldn't be two usernames the same. Its more likely there is a special character that's being ignored. Looking at the usernames the way I mentioned above should show you whats going on.
 
Very strange...

When I go to xf_user last imported member is "S5" with id 12066 but when I go to vbulletin database "user" and search for S5 or 12066 there is no results.
 
That is very strange. Without seeing the data I'm not sure I can help.
Without trying to offend.
What does this query show you when you run it in the vBulletin Database.
SELECT * FROM user WHERE userid > 12066
The above query should list you all the members where your issue starts
The first one. Should be the one with the issue.

Also on a side note, does the user S5 have an email? Can you search the vBulletin database with their email.
 
Else you can try this.
Where it says // save user
Change
$writer->save();
$userId = $writer->get('user_id');

to:
if ($writer->save()){
$userId = $writer->get('user_id');
}else{
continue;
}

This should skip that user, and any other users it errors on. I haven't tested it.

I was doing it wrong :) I did find user id 12066 in vbulletin "user" table...next user id 12067 doesn't have any special characters in username, everything looks ok.

I also tried quoted code but it doesn't work, I get same error.
 
Oh, I think I know what it is.. I bet its >= 25 characters. :) Am I right? If so I have a fix.
Xenforo Go to Options -> User Registration
Very bottom "User Name Length Limit"
Change the max to 40 for now. I recommend changing it back to 25 when your done.
On line 617 in the converter file, change
$writer->set('username', substr($row['username'], 0, 25));
to
$writer->set('username', substr($row['username'], 0, 40));
 
Last edited:
That is very strange. Without seeing the data I'm not sure I can help.
Without trying to offend.
What does this query show you when you run it in the vBulletin Database.
SELECT * FROM user WHERE userid > 12066
The above query should list you all the members where your issue starts
The first one. Should be the one with the issue.

Also on a side note, does the user S5 have an email? Can you search the vBulletin database with their email.

When I run that query I get list of users starting with id of 12067...this user have normal username and normal email.
User S5 also have normal email.
Only thing that maybe is not good is that user 12067 have empty membergroup id column (as many users after).
 
Oh, I think I know what it is.. I bet its >= 25 characters. :) Am I right? If so I have a fix.
Xenforo Go to Options -> User Registration
Very bottom "User Name Length Limit"
Change the max to 40 for now. I recommend changing it back to 25 when your done.
On line 617 in the converter file, change
$writer->set('username', substr($row['username'], 0, 25));
to
$writer->set('username', substr($row['username'], 0, 40));

I don't think that this is a problem as user 12066 have just 2 characters username - S5
Username for the next member, 12067. is slickster.

But I'll try this fix to.
 
Oh, I think I know what it is.. I bet its >= 25 characters. :) Am I right? If so I have a fix.
Xenforo Go to Options -> User Registration
Very bottom "User Name Length Limit"
Change the max to 40 for now. I recommend changing it back to 25 when your done.
On line 617 in the converter file, change
$writer->set('username', substr($row['username'], 0, 25));
to
$writer->set('username', substr($row['username'], 0, 40));

Look like that this was a problem :) and I got past cycle 8, but now I'm stuck at cycle 9 :(

error: 'Please enter a name without using control characters.'

How to skip this?
 
Hehe, that is a user using something weird in his name.
Follow the same procedure. Look at the user_id in xf_user. Then using that userid in vb database and look at the next one. It will have some special character in it.
Whatever that character is. You can do the same like you did with the comma.
 
Back
Top Bottom