Thursday, July 22, 2010

Bugzilla Migration

As part of datacenter movement from India to US, I had to migrate my Bugzilla installation to a new server in US.

After certain googling I found the steps to do the same, but then also I had to face some issues, thats the reason for this blog.

My current Bugzilla installation (ver. 3.0) is more customized for our company purpose so I had to stick on the same version for now. Following are the steps I followed on both servers.

On new Server:-
  1. Download the bugzilla-3.0.tar.gz from bugzilla.org (I had this on my old server, so I just copied from old to new server)
  2. Untar the software (#tar -xvf bugzilla-3.2.2.tar.gz )
  3. Rename it to bugzilla (#mv bugzilla-3.2.2.tar.gz bugzilla)
  4. Copy bugzilla to apache webroot directory (#cp -R bugzilla /var/www/html )
  5. Change the permission of bugzilla folder (#chmod -R 655 bugzilla)
  6. Change the ownership to apache web user (#chown -R apache bugzilla)

Now login in mysql & create database & username.

mysql> CREATE DATABASE bugs;

mysql>grant all on bugs.* to bugs@localhost identified by 'Your Password';

mysql>commit;

mysql>quit;

Now go to the bugzilla folder and run the checksetup.pl perl script, which will tell what are the prerequisites need to install and how. Here you may need to install lot of perl modules which you can manually download from CPAN and install (perl MakeFile.PL ; make ; make install) or you can use MCPAN shell commands.

#./checksetup.pl

Old Server:-

  1. Copy the data folder (/var/www/html/bugzilla/data) to the new server and replace the existing data folder with the same.
  2. Copy localconfig file from (/var/www/html/bugzilla) folder to the new server and replace the existing file with the same.
  3. Use mysqldump to make a backup of the bugs database. For a typical Bugzilla setup, such a command might look like this:
    mysqldump -u(username) -p(password) bugs > bugzilla-backup.sql
  4. Copy the bugzilla-backup.sql file to the new server.
New Server:-
  1. Restore the mysql data backup from the bugzilla-backup.sql file with the following command.
    mysql -u (username) -p(password) bugs < /path/to/bugzilla-backup.sql
If you get an error about "packet too large" or "mysql server has gone away", you need to adjust the max_allowed_packet setting in your my.cnf (usually in /etc/my.cnf) file to be larger than the largest attachment ever added to your Bugzilla.

If everything went well, run that "./checksetup.pl" file again and double confirm everything smooth.

Now go to web url & try to login with ur existing username password.

Yes now we all done the migration from old server to new.


Cheers !!!!!


1 comment:

  1. These are pretty good and detailed directions! :-)

    Anybody running across them should also know that there are official instructions on moving a Bugzilla installation, here, too:

    https://wiki.mozilla.org/Bugzilla:Move_Installation

    ReplyDelete