老的bugzilla系统的版本是4.4.8,目前需要升级。所在OS的版本是redhat5.4/5.6。
根据最近几天的反复尝试,发现:
bugzilla4.*对应的perl是5.8,而bugzilla5.*对应perl是5.10。
相对的redhat5.*里面的perl版本是5.8,而6.*对应的perl是5.10。
综上:如果使用bugzilla4.*,那么最好使用redhat5.*,bugzilla5.*则使用redhat6*。
目前还没有尝试在redhat5.11上讲perl由5.8升级到5.10。因为yum源中,5.11对应的perl就是5.8,如果升级可能需要连接到redhat6.*对应的yum源中,那么这中间因为包依赖,可能造成很多的问题。
这里升级bugzilla设计到了两个问题:
1 yum源配置。这里可能需要代理才能访问外网。那么有两种方法,一是环境变量设置,二是/etc/yum.conf里面的代理设置。
环境变量:
export http_proxy="http://10.99.93.34:8080/"
export https_proxy="https://10.99.93.34:8080/"
yum.conf设置:
proxy=http://10.99.93.34:8080/
2 perl的更新配置。即配置cpan,参考另外的文档。
接下来就可以升级bugzilla。
进入bugzilla的路径,运行./checkout.pl。
在另一台机器CentOS的机器上搭建bugzilla5,将bugzilla4的数据迁移过去。
也是执行./checkout.pl。
下面是对生产做simulation的过程:
1 克隆生产系统。这个由OS团队完成。
2 检查克隆后的系统,启动并登录,确保系统可用。
3 升级bugzilla。
升级bugzilla,主要是执行checksetup.pl程序。为了保证它能执行,首先需要做如下操作:
首先配置cpan,主要设置两个属性。
o conf urllist http://mirrors.sohu.com/CPAN/
o conf http_proxy http://10.99.93.33:8080/
一个是连接的cpan镜像地址,这里选择了sohu的,另一个是设置代理。
进入后安装了两个包:
install ExtUtils::MakeMaker
install version
第一个与bugzilla无关,只是我的检查已安装包的perl程序运行时需要用到。
第二个是bugzilla 4.4.11运行时报出需要的包,这个在老版本中不需要,就是4.4.11中需要的。
接下来运行checkset.pl,它提示需要一些新的perl包,运行下面程序安装:
perl install-module.pl --all
修改localconfig文件,主要是配置数据库的用户名密码。
再次运行./checksetup.pl,如果没有报错那么将完成升级。
升级成功:
[root@svnsubv bugzilla-4.4.11]# ./checksetup.pl
* This is Bugzilla 4.4.11 on perl 5.8.8
* Running on Linux 2.6.18-398.el5 #1 SMP Tue Aug 12 06:26:17 EDT 2014
Checking perl modules...
Checking for CGI.pm (v3.51) ok: found v4.27
Checking for Digest-SHA (any) ok: found v5.95
Checking for TimeDate (v2.23) ok: found v2.23
Checking for DateTime (v0.28) ok: found v1.24
Checking for DateTime-TimeZone (v0.71) ok: found v1.95
Checking for DBI (v1.54) ok: found v1.634
Checking for Template-Toolkit (v2.22) ok: found v2.22
Checking for Email-Send (v2.04) ok: found v2.198
Checking for Email-MIME (v1.904) ok: found v1.937
Checking for URI (v1.37) ok: found v1.71
Checking for List-MoreUtils (v0.32) ok: found v0.413
Checking for Math-Random-ISAAC (v1.0.1) ok: found v1.004
Checking available perl DBD modules...
Checking for DBD-Pg (v2.7.0) found v1.49
Checking for DBD-mysql (v4.001) ok: found v4.013
Checking for DBD-SQLite (v1.29) ok: found v1.50
Checking for DBD-Oracle (v1.19) not found
The following Perl modules are optional:
Checking for GD (v1.20) ok: found v2.44
Checking for Chart (v2.1.0) ok: found v2.4.1
Checking for Template-GD (any) ok: found v1.56
Checking for GDTextUtil (any) ok: found v0.86
Checking for GDGraph (any) ok: found v1.44
Checking for MIME-tools (v5.406) ok: found v5.427
Checking for libwww-perl (any) ok: found v2.033
Checking for XML-Twig (any) ok: found v3.32
Checking for PatchReader (v0.9.6) ok: found v0.9.6
Checking for perl-ldap (any) ok: found v0.39
Checking for Authen-SASL (any) ok: found v2.16
Checking for Net-SMTP-SSL (v1.01) ok: found v1.03
Checking for RadiusPerl (any) ok: found v0.24
Checking for SOAP-Lite (v0.712) ok: found v1.19
Checking for XMLRPC-Lite (v0.712) ok: found v0.717
Checking for JSON-RPC (any) ok: found v1.06
Checking for JSON-XS (v2.0) ok: found v3.02
Checking for Test-Taint (any) ok: found v1.06
Checking for HTML-Parser (v3.40) ok: found v3.72
Checking for HTML-Scrubber (any) ok: found v0.08
Checking for Encode (v2.21) ok: found v2.82
Checking for Encode-Detect (any) ok: found v1.01
Checking for Email-Reply (any) ok: found v1.202
Checking for HTML-FormatText-WithLinks (v0.13) ok: found v0.15
Checking for TheSchwartz (v1.07) ok: found v1.12
Checking for Daemon-Generic (any) not found
Checking for File-Slurp (v9999.13) not found
Checking for mod_perl (v1.999022) ok: found v2.000004
Checking for Apache-SizeLimit (v0.96) not found
Checking for File-MimeInfo (any) ok: found v0.27
Checking for IO-stringy (any) ok: found v2.110
Checking for mod_headers (any) ok
Checking for mod_expires (any) ok
Checking for mod_env (any) ok
***********************************************************************
* OPTIONAL MODULES *
***********************************************************************
* Certain Perl modules are not required by Bugzilla, but by *
* installing the latest version you gain access to additional *
* features. *
* *
* The optional modules you do not have installed are listed below, *
* with the name of the feature they enable. Below that table are the *
* commands to install each module. *
***********************************************************************
* MODULE NAME * ENABLES FEATURE(S) *
***********************************************************************
* Daemon-Generic * Mail Queueing *
* File-Slurp * Mail Queueing *
* Apache-SizeLimit * mod_perl *
***********************************************************************
COMMANDS TO INSTALL OPTIONAL MODULES:
Daemon-Generic: /usr/bin/perl install-module.pl Daemon::Generic
File-Slurp: /usr/bin/perl install-module.pl File::Slurp
Apache-SizeLimit: /usr/bin/perl install-module.pl Apache2::SizeLimit
To attempt an automatic install of every required and optional module
with one command, do:
/usr/bin/perl install-module.pl --all
Reading ./localconfig...
Checking for DBD-mysql (v4.001) ok: found v4.013
Checking for MySQL (v5.0.15) ok: found v5.6.20
Creating ./data directory...
Creating ./data/attachments directory...
Creating ./data/db directory...
Creating ./data/extensions directory...
Creating ./data/mining directory...
Creating ./data/webdot directory...
Creating ./graphs directory...
Creating ./skins/custom directory...
Creating ./data/extensions/additional...
Creating ./data/mailer.testfile...
Creating ./Bugzilla/.htaccess...
Creating ./data/.htaccess...
Creating ./data/attachments/.htaccess...
Creating ./data/webdot/.htaccess...
Creating ./graphs/.htaccess...
Creating ./lib/.htaccess...
Creating ./template/.htaccess...
Creating contrib/.htaccess...
Creating t/.htaccess...
Creating xt/.htaccess...
Precompiling templates...done.
Fixing file permissions...
Now that you have installed Bugzilla, you should visit the 'Parameters'
page (linked in the footer of the Administrator account) to ensure it
is set up as you wish - this includes setting the 'urlbase' option to
the correct URL.
checksetup.pl complete.
[root@svnsubv bugzilla-4.4.11]#
这一步完成后设计到一个文件权限的问题,bugzilla中的目录和文件的权限需要修改配置。
[root@svnsubv opt]# chown -R csvn:csvn bugzilla-4.4.11
[root@svnsubv bugzilla-4.4.11]# find ./ -type d -exec chmod go+rx {} \;
[root@svnsubv bugzilla-4.4.11]# find ./ -type f -exec chmod go+r {} \;
[root@svnsubv bugzilla-4.4.11]#
接下来要修改httpd的配置,即collabnet_subversion的配置。
/etc/opt/CollabNet_Subversion/conf/httpd.conf
DocumentRoot "/opt/bugzilla-4.4.11"
<Directory "/opt/bugzilla-4.4.11">
AddHandler cgi-script .cgi
Options Indexes ExecCGI FollowSymLinks
DirectoryIndex index.cgi
AllowOverride None
Order allow,deny
Allow from all
</Directory>
另外,还需要修改bugzilla下的配置文件data/params。
'mail_delivery_method' => 'SMTP',
'mailfrom' => '[email protected]',
'maintainer' => '[email protected]',
'maxattachmentsize' => '10000',
'urlbase' => 'http://10.96.20.45/'
升级过程中遇到的问题:
运行checksetup.pl时报包的缺失问题。
[root@svnsubv bugzilla-4.4.11]# ./checksetup.pl
Can't locate version.pm in @INC (@INC contains: . lib /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8) at Bugzilla/Install/Requirements.pm line 17.
BEGIN failed--compilation aborted at Bugzilla/Install/Requirements.pm line 17.
Compilation failed in require at ./checksetup.pl line 26.
BEGIN failed--compilation aborted at ./checksetup.pl line 26.
这主要是缺少version.pm,进入cpan执行install version即可。
升级完毕后页面报错:
Software error:
Bareword "USER_MATCH_FAILED" not allowed while "strict subs" in use at Bugzilla/Flag.pm line 810.
Bareword "USER_MATCH_MULTIPLE" not allowed while "strict subs" in use at Bugzilla/Flag.pm line 810.
Compilation failed in require at Bugzilla.pm line 36.
BEGIN failed--compilation aborted at Bugzilla.pm line 36.
Compilation failed in require at /opt/bugzilla-4.4.11/index.cgi line 19.
BEGIN failed--compilation aborted at /opt/bugzilla-4.4.11/index.cgi line 19.
For help, please send mail to the webmaster ([email protected]), giving this error message and the time and date of the error.
经过多次尝试,最终得出实验结果为:克隆的server上,运行完4.4.11下的checksetup.pl。当httpd.conf下的DocumentRoot设置在4.4.8下,页面显示没有问题,而切换到4.4.11下后出现上面列出的错误。
经过多次实验发现,这个错误与bugzilla下的lib目录有关,将4.4.8的lib目录替换掉4.4.11的lib目录后问题解决。
由此来看可能是perl中的模块的问题,比如模块版本。
最后,在cpan中升级已安装的包。在升级过程中,某些包的升级是失败的,中间执行到某一步时cpan卡主很久没有反应,不得以取消。
cpan>upgrade
后来又包version/vpp.pm找不到,查了一下原因,是因为version/vpp.pm所在的目录没有权限,导致非root用户无法访问,修改权限后系统恢复。
至此,升级bugzilla完成。