Friday, April 17, 2009

How To Upgrade Bugzilla to 3.2 or latest?

Dear All,

If you guys want to upgrade the bugzilla (I did it from 3.0.1) to bugzilla 3.2 (the latest stable version as on, 25th JAN, 2009 and before the next one 3.4) please spent 2 to 4 hours around with me.

Prerequisits:

1) Existing bugzilla host should work properly ( for earlier bugzilla's I've no experience), with successful pinging to www.google.com (seams accessing of Internet is OK)

2) Take a backup of all database and bugzilla stufs [i.e. the old bugzilla folder and mysql folder etc. or dumping everything to a SQL script file using 'MYSQL Administrator' tool]. So that we can revert it back to the current configuration and let our organization be running cooool with previous one.

Lets Jump into:

1) From client browser login into the existing bugzilla server as Admin, and make notes of all the 'Parameters' settings you are currently using for your organization's setup.

2) Login into the Bugzilla server as 'root'-user through putty (windows ssh client) or into the direct bugzilla host. Your console prompt would be like 'root@bugzilla ~#' and use following commands.

3) cd
4) ls
5) cp -r bugzilla backup.bugzilla.301 [as my old bugzilla version was 3.0.1]
6) wget http://ftp.mozilla.org/pub/mozilla.org/webtools/bugzilla-3.2.tar.gz or explore the latest release download URL (try several times if Internet connection/DNS resolution fails/for looking for mirrors)
7) tar -xvf bugzilla-3.2.tar.gz [it will extract every thing into a new directory namely 'bugzilla-3.2', please verify with 'ls' command]
8) cd bugzilla-3.2 [to verify about the extracted files by 'ls' command]



9) mysql -u root -p
[enter your mysql 'root' login password if you have any]. Your prompt should be like 'mysql>'

10) show databases; [for checking]
11) change you existing 'bugs' bugs-db user's password by [if you are using the default, i.e. 'bugs'] -- this is required to stop checksetup.pl to asks for a change/check mysql db_* settings, because we don't want to corrupt existing installation.

mysql> GRANT SELECT, INSERT, UPDATE, DELETE, INDEX, ALTER, CREATE, LOCK TABLES,
-> CREATE TEMPORARY TABLES, DROP, REFERENCES ON bugs.* (existing db)
-> TO bugs@localhost (existing 'bugs' user/login) IDENTIFIED BY 'bugspasswd' (resetting to new password);
or GRANT ALL on bugs.* TO bugs@localhost IDENTIFIED BY 'bugspasswd';

mysql> FLUSH PRIVILEGES;

-- please don't use the inline-comment I used like (existing db), (existing ...), (resetting ...) but

mysql> GRANT ALL on bugs.* TO bugs@localhost IDENTIFIED BY 'bugspasswd';


mysql> FLUSH PRIVILEGES;

12) now create new login for Bugzilla-3.2 testing only as follows:

mysql> GRANT ALL ON bugs320.*
-> TO bugs320@localhost IDENTIFIED BY 'bugs320passwd';

mysql> FLUSH PRIVILEGES;

mysql> exit;

13) Double check wheather bugs and bugs320 login are working fine otherwise you've to repeat step 11 and 12 carefully.

root@bugzilla ....# mysql -u bugs -p [login should be successful]
root@bugzilla ....# mysql -u bugs320 -p [login should be successful]

if you use 'show databases;' SQL you'll see only 'information_schema' database only for 'bugs320' login

mysql> exit;

14) root....# cd ../bugzilla [your existing bugzilla folder, as we don't want to do any changes to your Apache or webserver in this session]
15) rm -rf *, if asks for yes/no press y
16) ls [for verify - you'll see no files]
17) cp -r ../bugzilla-3.2/* .
18) ls [you will see all 3.2 bugzilla files here]

--now be ready to run checksetup.pl script and upgrate existing 'perl' installation to support bugzilla-3.2 features

19) open another consele namely tty2 by pressing alt+F2 and login as 'root'-user
20) pwd [will show you /root, the home of 'root'-usr]
21) ls -al [ you'll see '.cpan' empty-directory ]
22) not needded but make a backup of .cpan by following command so that we can revert it back if required as follows

cp -r .cpan backpup.cpan [a non hidden directory]
23) now switch to tty1 by pressing alt+F1
24) root..../bugzilla# /usr/bin/perl checksetup.pl
25) you may loss some information due to screen scrolling but don't worried as we'll bypass it as per our requirements
25-a) ..../bugzilla# /usr/bin/perl checksetup.pl > test
26) switch to tty2 by pressing alt+F2
27) cat ..../bugzilla/test | less [we can use page-up,page-doun]

28) Look for the section namely 'REQUIRED MODULE'
like 'CGI' and Email::MIME and some OPTIONAL MODULE ALSO, but REQUIRED modules are mandatory

29) switch to tty3 by pressing alt+F3 and login as 'root'-user
30) cd .cpan [ as u r in /root/.cpan now]
31) ls [no files or directory are present till now]
32) /usr/bin/perl install-module.pl CGI or Email::MIME may give error and asking for install CPAN module to upgrade first. [if you faced any error similar judt empty the /root/.cpan directory otherwise CPAN will fail to download or installation -- its better to empty the /root/.cpan directory by rm -rf * [be sure you are in /root/.cpan] and if asks press 'y'

33) /usr/bin/perl install-module.pl CPAN

if mirror resolution fails you've to repeat the step 33) untill CPAN is completly downloaded (not partially) -- if it will take long time to download you think more than 5 minutes or it seems stucks due to some Internet connectiviey just press ctrl+c or ctrl+z and repeate the step 33)

--cheers download is successfully completed now

*34) If you see

--- Checking if your kit is complete...
Looks good
...Writing make file for CPAN
-- NOT OK
Running make test
can't test without successfull make
Running make install
make had returned bad status, install seems impossible
----

Don't be worried but we'll do it (install CPAN and all following perl modules ) manually

PS: if you follow the sereen you'll see some other modules shuld be installed along with the checksetup.pl recommended and CPAN is a must and first downloadable module otherwise following download of rest modules will not be possible

35) /usr/bin/perl install-module.pl Test::Harness/Email::MIME/CGI
36) /usr/bin/perl install-module.pl Authen::SASL
if asks auto install the optional modules form CPAN [y] .. press 'y'
if asks for some missing modules please download those modules firs and then Authen::SASL (like Digest::MD5;Digest::HMAC_MD5 - all thease optional modules)

37) /usr/bin/perl install-module.pl Authen::Radius [if you want to use radius server for authentication]

38) /usr/bin/perl install-module.pl mod_perl2
if it asks for path to 'apxs' --press enter
if it asks for apache home directory -- press ctrl+c or ctrl+z

-- as we are not going to make any change with the existing apache/apache2 right now -- if you are confident you can proceed --

39) /usr/bin/perl install-module.pl --all [if you wish some more modules to install - goon with your own RnD]

if so ... it may ask you for configure pg-config [prostgre database] , just say 'no'/ctrl+c as we'll use and happy with MySQL

40) Lets move for manual installation of the downloaded perl modules by switching to tty3/putty (another console)

41) root@bugzilla~/.cpan# ls [you will see the directory 'build']
42) cd build [and do 'ls', all downloaded modules are here]
43) for each modules you've to repeat the following steps
cd [module's directory]

a) /usr/bin/perl Makefiel.PL ==> Writing Makefile for module - cool.gif
b) make
c) make test ==> ok, ok, ok, .. RESULT PASS (100%, 95%, 99% whatever)
d) make install

repeate step 43) and a, b, c, d for following modules

Test::Harness,CPAN,CGI,Email::MIME, - Digest::HMAC, Digest::HexDump, Authen::Radius, Authen::SASL [look for any warning it displays for prerequisite]

Radius server hostname and port - just press enter if you don't know, all these modules can be reconfigure if required in future

ref: http://www.bugzilla.org/docs/tip/en/html/parameters.html

for Authen::SASL
-- auto-commit [I've no idea yet so put 'no']
-- parameters for the 'perl' 'Build.PL' command[] - press enter [no idea yet]
& repeat these two steps or as pre your knowledge base for make, make test and make install

NB: in case of perl module download failure repeat wget several times to completely download the required modules.

If you think you've issues with GCC then download the GCC-complete-tar-file from "http://gcc.gnu.org/releases.html" and build and install manually or install it by commands like yum, yast, apt-get etc.


44) if you are ok with existing Apache don't install mod_perl2 or if you are confident enough then install it

45) Now switch to tty1 [we are ready to run checksetup.pl script]
46) /usr/bin/perl checksetup.pl
47) it will prompt to change your 'localconfig' file for db_user, db_pass, db_name, webservergroup etc.

48) keep a backup of localconfig as backup.localconfig and edit the localconfig file with your suitable editor [vi]

49) change followings
webservergroup='', db_name='bugs320', db_user='bugs320', db_pass='bugs320password', db_driver='mysql' rest are ok ... save the file and exit

50) /usr/bin/perl checksetup.pl
51) if it prompts as follows:
-- 'creating database bugs320 ....
InnoDB is disabled in your MySQL installation
Bugzilla requires it to be enable it .... do followigs to enable it

vi /etc/mysql/my.cnf [or vi /etc/my.cnf or vi manual-install-path/etc/my.cnf etc.]

/InnoDB -- vi search, and look following lines for 'skip_innodb' and just comment this line and save the file my.cnf and exit

NB: InnoDB (enables foreign-key related things between tables) installation and configuration may vary according to the MySQL version and installation package types

52) restart the mysql daemon (/etc/init.d/mysql restart or the-manual-mysql-installation-directory/mysql restart etc.) or just reboot the HOST by init 6
53) let HOST be ready again and login and 'root'-user again
54) cd .../bugzilla
55) /usr/bin/perl checksetup.pl

56) it will ask you for administration email,name and password for bugzilla-3.2
57) YES YOU ARE READY now to test your installation

58) Check your installation from client's browser and check everything is working or not by login as administrator

59) Yes, folks I know that your are happy now - yes everything is working fine
60) Time to use the existing bugs database instead of bugs320 -- so do followings
61) vi the 'localconfig' file and change the db_name, db_user, and db_pass to yor previous [bugs/bugs/bugspassword -- as u changed at earley steps]

62) /usr/bin/perl checksetup.pl
63) ==> Converting ...., Adding foreign key ... done at last
64) Recheck from your client browser wheather every thing is working fine or not
65) You may need to re-configure the 'Parameters' section only [as you did backup note - at step

Lets Jump into: section 1) ] from your previous settings.

66) That's ALL FOLKS


Warm regards and cheerio for now
Himadri Sekhar Das
APT / Kolkata/ India
das.himuinkol@gmail.com
www.aptsoftware.com

Ref: http://www.bugzilla.org, debian.org, almworks.com

No comments:

Post a Comment