略去导航.
主页
The image verification code you entered is incorrect.

bugzilla升级

今天总算花点时间将原来在2003年安装的bugzilla-2.16.3系统升级到最新的稳定版本bugzilla-2.22.2。bugzilla-2.22.2需要mysql 4.0.14或者更高版本。原来的bugzilla系统是使用mysql-3.23.58和GB2312编码,我的目标mysql是4.1.20版本,使用UTF8编码。中间的编码转换费了一些周折,“iconv -f gb2312 -t utf-8 -c”可以将GB2312的转换到UTF8的,但不能将mysqldump出来的SQL语言全部通过iconv做转换,否则bugzilla中attachments附件在升级后的系统中不能显示,因为iconv会破坏‘二进制的attachments附件。所以,数据迁移时要将attachments表分开考虑,不作转换。

mysql的数据迁移的命令基本如下:

mysqldump --opt --default-character-set=latin1 -u bugs bugs attachstatusdefs attachstatuses bugs bugs_activity cc components dependencies duplicates fielddefs groups keyworddefs keywords logincookies longdescs milestones namedqueries products profiles profiles_activity shadowlog tokens versions votes watch | iconv -f gb2312 -t utf-8 -c | bzip2 > tables.sql.bz2

mysqldump --opt --default-character-set=latin1 -u bugs bugs attachments | bzip2 > attachments.sql.bz2

在mysql-4.1.20的机器执行下面命令恢复数据:

bzip2 -dc tables.sql.bz2 | mysql -u bugs -p bugs
bzip2 -dc attachments.sql.bz2 | mysql -u bugs -p bugs

注:不需要执行什么"SET NAMES utf8;"

bugzilla的升级照着文档做就可以了,最后执行一下checksetup.pl升级数据库表结构就可以了。bugzilla的升级程序确实做得挺好的。:)

回复

  • 允许 HTML标签: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • 行和段被自动切分。
  • 你可以用[inline:xx] 标记来内嵌显示上传的文件或者图片。
更多格式化选项信息 Captcha Image: you will need to recognize the text in it.
Please type in the letters/numbers that are shown in the image above.