老的bugzilla系統的版本是4.4.8,目前須要升級。所在OS的版本是redhat5.4/5.6。html
根據最近幾天的反覆嘗試,發現:mysql
bugzilla4.*對應的perl是5.8,而bugzilla5.*對應perl是5.10。linux
相對的redhat5.*裏面的perl版本是5.8,而6.*對應的perl是5.10。web
綜上:若是使用bugzilla4.*,那麼最好使用redhat5.*,bugzilla5.*則使用redhat6*。sql
目前尚未嘗試在redhat5.11上講perl由5.8升級到5.10。由於yum源中,5.11對應的perl就是5.8,若是升級可能須要鏈接到redhat6.*對應的yum源中,那麼這中間由於包依賴,可能形成不少的問題。shell
這裏升級bugzilla設計到了兩個問題:數據庫
1 yum源配置。這裏可能須要代理才能訪問外網。那麼有兩種方法,一是環境變量設置,二是/etc/yum.conf裏面的代理設置。dom
環境變量:ide
export http_proxy="http://10.99.93.34:8080/"svn
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' => 'lenovo-bugs@lenovo.com',
'maintainer' => 'caozy1@lenovo.com',
'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 (you@example.com), 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完成。