2010年12月31日 星期五

升級 Bugzilla

 最近要將 Bugzilla 3.0.4 轉移到 Hyper-V 上,順便更新為新版的 Bugzilla 3.6.3,原本想試著從MySQL 直接匯出匯入,但發現不行,因為新版的 Bugzilla 所使用的欄位有異動,所以這方法是不可行的,只好要將原機的 Bugzilla 3.0.4 升級至 3.6.3,再將 DB 匯出匯入。

 根據 Bugzilla 官方文件,有三種升級方式,而且不管是大版本還是小版本升級都很簡單,且都一樣。
1. CVS
2. Tarball
3. Patches


 我選擇使用第二種 Tarball,因為我的版本是從 v3 最早升級到最後版本,使用 Patches 升級會需下載太多 Patch。


一、備份資料
 在升級前都要先備份好資料。
 MySQL:
  mysqldump --opt -u bugs -p bugs > bugs.sql

 PostgreSQL:
  pg_dump --no-privileges --no-owner -h localhost -U bugs > bugs.sql


二、版本升級
 1. 下載最新版的 bugzilla 置換舊版 bugzilla
  # cd /var/www/html  # wget http://ftp.mozilla.org/pub/mozilla.org/webtools/bugzilla-3.6.3.tar.gz
  # tar xzvf bugzilla-3.6.3.tar.gz  # mv bugzilla bugzilla-3.0.4 ←將舊版 Bugzilla 更名  # mv bugzilla-3.6.3 bugzilla ←將新版 Bugzilla 置換  # cp bugzilla-3.0.4/localconfig* bugzilla/ ←將舊版 localconfig 參數複製到新版 Bugzilla  # cp -R bugzilla-3.0.4/data bugzilla/ ←將舊版設定檔複製到新版 Bugzilla

 2. 檢查模組
  # cd bugzilla  # ./checksetup.pl --check-modules* This is Bugzilla 3.6.3 on perl 5.8.8
* Running on Linux 2.6.18-194.el5 #1 SMP Fri Apr 2 14:58:35 EDT 2010
Checking perl modules...
Checking for              CGI.pm (v3.21)   ok: found v3.49
Checking for          Digest-SHA (any)      not foundChecking for            TimeDate (v2.21)   ok: found v2.22
Checking for            DateTime (v0.28)    not foundChecking for   DateTime-TimeZone (v0.71)    not foundChecking for                 DBI (v1.41)   ok: found v1.52
...................
To attempt an automatic install of every required and optional module
with one command, do:
  /usr/bin/perl install-module.pl --all
*** Installation aborted. Read the messages above. ***

  # /usr/bin/perl install-module.pl --all ←更新模組....................
Installing /var/www/html/bugzilla3/lib/man/man3/Bundle::DBD::mysql.3pm
Installing /var/www/html/bugzilla3/lib/man/man3/DBD::mysql.3pm
Installing /var/www/html/bugzilla3/lib/man/man3/DBD::mysql::INSTALL.3pm
Appending installation info to /var/www/html/bugzilla3/lib/i386-linux-thread-multi/perllocal.pod
  CAPTTOFU/DBD-mysql-4.018.tar.gz
  /usr/bin/make install  -- OK

  # ./checksetup.pl ←準備升級,第一次執行會先確認localconfig 是否存在* This is Bugzilla 3.6.3 on perl 5.8.8
* Running on Linux 2.6.18-194.el5 #1 SMP Fri Apr 2 14:58:35 EDT 2010
Checking perl modules...
Checking for              CGI.pm (v3.21)   ok: found v3.49
Checking for          Digest-SHA (any)     ok: found v5.50
.....................
Checking for      Daemon-Generic (any)     ok: found v0.71
Checking for            mod_perl (v1.999022) ok: found v2.000004
Reading ./localconfig...
This version of Bugzilla contains some variables that you may want to
change and adapt to your local settings. Please edit the file
./localconfig and rerun checksetup.pl.
The following variables are new to ./localconfig since you last ran
checksetup.pl:  use_suexec, site_wide_secret

  # ./checksetup.pl ←這次真的開始升級,中間會提示UTF8編碼問題,請依訊息決定是否繼續升級* This is Bugzilla 3.6.3 on perl 5.8.8
* Running on Linux 2.6.18-194.el5 #1 SMP Fri Apr 2 14:58:35 EDT 2010
Checking perl modules...
Checking for              CGI.pm (v3.21)   ok: found v3.49
Checking for          Digest-SHA (any)     ok: found v5.50
.....................
Adding new table ts_funcmap ...
Adding new table ts_job ...
Adding new table ts_note ...
WARNING: We are about to convert your table storage format to UTF8. This
         allows Bugzilla to correctly store and sort international characters.
         However, if you have any non-UTF-8 data in your database,
         it ***WILL BE DELETED*** by this process. So, before
         you continue with checksetup.pl, if you have any non-UTF-8
         data (or even if you're not sure) you should press Ctrl-C now
         to interrupt checksetup.pl, and run contrib/recode.pl to make all
         the data in your database into UTF-8. You should also back up your
         database before continuing. This will affect every single table
         in the database, even non-Bugzilla tables.
         If you ever used a version of Bugzilla before 2.22, we STRONGLY
         recommend that you stop checksetup.pl NOW and run contrib/recode.pl.
         Press Enter to continue or Ctrl-C to exit... ←提示是否要轉換UTF-8,要按 Enter 繼續,否則無法繼續升級
Converting table storage format to UTF-8. This may take a while.
H_CALENDAR.SYS_CALENDAR_TYPE needs to be converted to UTF-8...
H_CALENDAR.SYS_CALENDAR_LEAVE needs to be converted to UTF-8...
H_CALENDAR.SYS_CALENDAR_SET needs to be converted to UTF-8...
H_CALENDAR.IS_SET needs to be converted to UTF-8...
H_CALENDAR.IS_ADJUST needs to be converted to UTF-8...
H_CALENDAR.IS_RESTORE needs to be converted to UTF-8...
.....................
Adding a new user setting called 'quote_replies'
Adding a new user setting called 'timezone'
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.

  
 3. 升級完成
  開啟 http://ip_address/bugzilla 就可以看見新版畫面。


沒有留言:

張貼留言