老代码为 FB2000v1.0909 升级到新代码 smthbbs-1.2-snapshot
共享一些 tips 吧 省得走我的弯路 :)
1. 打包备份老系统的 bbs/ bbssrc/
mv bbs bbs.2k
2. 获得 smthbbs 源码包,解压
3. 在 fb2k-v2.h fb2k-v2.c 的基础上修改定制自己的 BBS
注意 fb2k-v2.h 中的 SECNUM,fb2k-v2.c 中的 seccode explain 等
要与原系统一致
4. 修改 contrib/fb2k2smth/convboards.c seccode{}
5. 编译 (for rh9)
./configure --prefix=/usr/local/bbs --enable-site=fb2k-v2 --with-www=/var/www \
--with-php=/usr/include/php --with-mysql --enable-ssh --enable-ssl \
--enable-innbbsd && make
6. 安装 smthbbs
make install && make install-home
7. 启动测试 smthbbs
cd /usr/local/bbs/bin
./miscd daemon && ./bbslogd && ./bbsd -p 23
telnet localhost 23
没问题后
killall miscd && killall bbslogd && killall bbsd
ipcs|awk '/bbs/ {system(sprintf("ipcrm shm %s",$2));}'
8. 转移老 BBS 数据
rm -rf home/ mail/ vote/ boards/ 0Announce/ .PASSWDS .BOARDS
bbs.2k 下
mv home/ mail/ vote/ boards/ 0Announce/ .PASSWDS .BOARDS /usr/local/bbs
mv .PASSWDS .PASSWDS.OLD
mv .BOARDS .BOARDS,OLD
9. 转用户数据文件
用 bbs 在 bbs/bin/ 下 ./convpasswd
将 新生成的 .PASSWDS.NEW 改为 .PASSWDS
此时可以运行 ./chlevel 通过输出的结果大致检查一下 .PASSWDS 是否正确
如果在 fb2k-v2.h 中没有定义 HAVE_BIRTHDAY HAVE_USERMONEY 的
话,转换会出错,在 convpasswd.c 中将 #ifdef HAVE_USERMONEY
#ifdef HAVE_BIRTHDAY 注释掉,编译安装 fb2k2smth/ 即可
开启 bbs ,./miscd daemon && ./bbslogd && ./bbsd -p 23
测试用户数据
refriends 转化好友名单 chfavbrds 转化个人定制区
10.转换版面数据文件
现在打包中的 convboards.c 中的 fileheader 是 site.h 中的默认
即如果直接 ./convboards 就从 oldfileheader 中读 fb2k 的结构,直接写为
smthbbs-1.2 的结构,这样后面 ./strip_fh --all 就会出错!!
导致版面文章乱码,所以在 convboards.c 中加入 smthbbs-1.1 的 fileheader
定义,后面就不会出错了。
在 convboards.c 中加入
typedef struct fileheader11 { /* This structure is used to hold data in */
char filename[20]; /* the DIR files */
unsigned int id, groupid, reid;
char unused1[46];
char innflag[2];
char owner[30];
char unused2[42];
unsigned int eff_size;
long attachment;
char title[80];
unsigned level;
unsigned char accessed[12]; /* struct size = 256 bytes */
} fileheader11;
将 convboards.c 中的 fileheader 全部替换为 fileheader11。
用 bbs ./convboards 做转换。
此时上站的话版面文章、用户信件都是乱码,停掉 bbs,杀共享内存 !!
killall miscd && killall bbslogd && killall bbsd
ipcs|awk '/bbs/ {system(sprintf("ipcrm shm %s",$2));}'
用 bbs ./strip_fh --all 后,杀共享内存 !!
ipcs|awk '/bbs/ {system(sprintf("ipcrm shm %s",$2));}'
重启 bbs 后版面文章,用户信件都转化完成。
还是用 smth 舒服啊
bless all
感谢水木清华技术站务组的辛勤劳动
参考了 flyriver 的 smthbbs 安装手册
参考了 wisi 的 smthbbs-1.1 到 smthbbs-1.2 升级说明
受 stiger Czz 的热心指导,非常感谢 :)
--
修改:edwwq FROM 166.111.74.*
FROM 219.224.145.*