6.0Ecms如何装用户转移到discuz论坛中?
有在网络上找这种方法,但是试了不管用.帮忙看看是什么问题?
动手:
1 备份 cdb_members 和 phome_enewsmember,嘿嘿,无论做什么事情,尤其这种数据操作,备份没有坏处,给自己留条万一不成功的后路。做人也是这样的哦,有点扯远了。(可以再复制到另外两个表中,比如cdb_members1和phome_enewsmember1)
2 查看你的dz已经注册多少用户,将注册的用户数的个数记为N,执行SQL语句
update phome_enewsmember1 set userid=userid+N
解释:保证你phome_enewsmember1中的userid,可以顺序添加到cdb_members中的uid后
3 将phome_enewsmember1中的数据添加到cdb_members中,执行SQL语句
insert into cdb_members (uid,username,password,secques,gender,adminid,groupid,groupexpiry,extgroupids,regip,regdate,lastip,lastvisit,lastactivity,lastpost,posts,digestposts,oltime,pageviews,credits,extcredits1,extcredits2,extcredits3,extcredits4,extcredits5,extcredits6,extcredits7,extcredits8,email,bday,sigstatus,tpp,ppp,styleid,dateformat,timeformat,pmsound,showemail,newsletter,invisible,timeoffset,newpm,accessmasks,editormode,customshow,xspacestatus,enewsgroupid,enewsrnd,enewsuserfen,enewsmoney,enewsuserdate,enewstodaydate,enewstodaydown,enewszgroupid,enewshavemsg) select userid,username,password,'',0,0,10,0,'','',1179119279,'',1179119279,1179119279,0,0,0,0,0,0,0,0,0,0,0,0,0,0,email,0000-00-00,0,0,0,0,'',0,0,0,1,0,9999,1,0,2,26,0,groupid,rnd,userfen,money,userdate,todaydate,todaydown,zgroupid,havemsg from phome_enewsmember;
解释:这个是保证将phome_enewsmember中的userid,username,password和email导入到dz的cdb_members中,其中的数字10为用户组,数字串1179119279是注册时间以及登陆时间等,这个数字转换之后是20070514,你可以改成你想要的时间。
4 将phome_enewsmember1中的userid导入到 cdb_memberfields中,执行SQL语句
insert into cdb_memberfields (uid,nickname,site,alipay,icq,qq,yahoo,msn,taobao,location,customstatus,medals,avatar,avatarwidth,avatarheight,bio,sightml,ignorepm,groupterms,authstr,spacename) select userid,'','','','','','','','','','','','',0,0,'','','','','','' from phome_enewsmember1
这些做完后去dz的后台里面更新数据缓存,就ok了!
可能碰到的问题:
1 如果phome_enewsmember内部,或者与cdb_members中有相同的用户名,那么将不会导入成功,你可以根据导入时出现的错误提示将相同的username删除,SQL语句为:
select * from phome_enewsmember1 where username='相同的username'
2 如果只是将phome_enewsmember的部分数据导入cdb_members中而出错,想重新导入,可以使用如下SQL命令来删除导入的数据:
delete from cdb_members where uid>N
按这个方法没有效果,请问什么地方出了错误? |