Bulk register users for vbulletin.

Sometimes we need to register a lot of new users for our forum based on vbulletin. How to do then? Here, I will share my methods with you.

1. arrange the new user names in at .txt file, one line only display one user name;
2. create a .xml file and upload the .txt data;
3. resave the .xml file as .csv file;
4. run phpmyadmin, and creat a table under your vbuletin database, and import the .csv file to the new table; take care that the new tabe should use field name which is the same as your vbulletin user name field;

5.add the non-duplicate user names to your vbullin old table from the new table;
6. update the newly added user names according to one of the old user name data.

The following code may be useful for you.
insert into vbb_user(usergroupid,username,password,usertitle,daysprune,reputationlevelid,options,salt) values(2,'glasses','encrypted password','Junior Member', -1,-5,'45108311','salt value'); // add a new user name called "glasses"

update vbb_user set showvbcode=1,showbirthday=0,daysprune=-1,timezoneoffset=0, reputationlevelid=5,startofweek=-1 where usergroupid=2; //update some fields values

update vbb_user set usergroupid=2,password='encrypted password',usertitle='Junior Member', showvbcode=1,showbirthday=0,daysprune=-1,timezoneoffset=0, reputationlevelid=5,startofweek=-1,daysprune=-1,reputationlevelid=-5,options='45108311',salt='salt value',joindate='1331564520' where usergroupid=0;// update more fields values

alter table city change comment username varchar(50); //modify field name

insert into vbb_user
select username
from city
where not exists (select * from vbb_user
where vbb_user.username=city.username);

alter table city change comment username varchar(50); // alter field name

update city set username = concat(username,' Glasses') WHERE passworddate='0000-00-00'; //add Glasses after each username if passworddate='0000-00-00'

DELETE FROM forum_user WHERE password='encrypted password'; //delete a user if its password='encrypted password'

alter table vbb_user rename forum_user //alter table name

update vbb_user set username = TRIM(username); // deletel blank from user name

update forum_user set username=left(username,instr(username,'city')-1) where username like '%city%' //delete city from username; // delete city from user name


// inser user names from field: name of table: babyname
to forum_user

insert into forums_user
select name
from babyname
where not exists (select * from forums_user
where forums_user.username=babyname.name);

// update user information where usergroupid=0
update forums_user set usergroupid=2,password=”encrypted password”,usertitle=”Junior Member”, showvbcode=1,showbirthday=0,daysprune=-1,timezoneoffset=0, reputationlevelid=5,startofweek=-1,daysprune=-1,reputationlevelid=-5,options=”45108311″,salt=”salt value”,joindate=”1350815760″ where usergroupid=0;