Friday, July 23, 2010

Mediawiki Migration

This is again I have done as part of our datacenter movement from India to US. We are on the recent release of mediawiki (1.15.2), I just need to make the ditto box in US before shutting down the old one in India. There are plenty of help articles on internet which helped me to do the same, again I am detailing here because of my future reference and ofcourse may help somebody like you.

The following are the details of the software versions installed on both the boxes.

MediaWiki 1.15.2
PHP 5.1.6 (apache2handler)
MySQL 5.0.77

Lets start the detailed step of the upgrade as follows,

On Old Server:-
  1. Shutdown apache server for stoping further updates to the wiki (#service httpd stop)
  2. Backed up all the content of the web folder of apache (mediawiki files) (#tar -zcvf wiki.tar.gz /var/www/html/wiki)
  3. Copy the tar file to the new server
  4. Dump the MySQL database (#mysqldump -u (username) -p (password) wikidb >backup-wikidb.sql )
  5. Copy the dump file to the new server
On the New Server:-
  • Restore the database from the backup-wikidb.sql file (sql>mysql -u (username) -p (password) wikidb )
  • Untar the copied wiki.tar.gz file and copy it in to the documentroot of apache (#tar -zxvf wiki.tar.gz; cp -R wiki /var/www/html)
  • Edit the Localsettings.php and Adminsettings.php files to match the wikidb and wiki user credentials
  • Restart apache server (#service httpd restart)
  • If everything went well go and browse the wiki with existing user credentials.
Yes we have finished the movement of mediawiki from old server to new server...!!!

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 !!!!!