FreeBSDupgradeTo3 8 2

From Request Tracker Wiki
Jump to navigation Jump to search

WARNING: This notes are user experience and don't free you from reading README, UPGRADING and UPGRADING.mysql (if you are on mysql DB) files. You MUST read them.

Steffan below skipped upgrading mysql DB and most probably has broken attachments and/or malfunctioning RT.

My notes on our upgrade of 3.4.2 to 3.8.2. Existing server is running FreeBSD 5.4 and we used the FreeBSDInstallGuide to help us get going originally.

Other pages that helped me: ManualInstallation, MultipleInstances, FastCGIConfiguration

Ok... on with the show:

  • Shut down Apache so nobody can get to RT.
  • Make DB backup
home [/usr/homex]# mysqldump -p --opt rt3_4 > RT34_Backup.sql
  Enter password: xxxxxxxxx
  • Download new tar file into /usr/local/src/
  • Untar it and fire up configure with all needed options. Look at them closely as you'll likely need to adjust:
./configure '--prefix=/usr/local/rt3' '--enable-layout=RT3' '--with-web-user=nobody' '--with-web-group=nobody' '--with-libs-group=wheel'
'' '--with-db-port=' '--with-db-type=mysql' '--with-db-rt-user=rt34' '--with-db-rt-pass=xxxxxxxx '
'--with-db-database=rt_upgrade' '--with-db-dba=root' '--mandir=/usr/local/man' '--infodir=/usr/local/info/' 'CC=cc'
'CFLAGS=-O2' --with-apachectl=/usr/local/apache/bin/apachectl --enable-gd --enable-graphviz
  • Fix the needed dependencies (work through the cpan stuff)
[usr/local/src/rt-3.8.2]# make fixdeps
  • Had to manual install a few packages:
[/usr/local/src/rt-3.8.2]# wget
[/usr/local/src/rt-3.8.2]# wget
  • Install them by untaring and doing the standard: ./configure; make install
  • RT complained later saying it couldn't find the graphviz exe, so I softlinked it:
[/]# ln -s /usr/local/bin/dot /usr/bin/dot
  • Try again and again till no errors
[/usr/local/src/rt-3.8.2]# make fixdep
  • Now upgrade your DB:
[/]# /usr/local/rt3/sbin/rt-setup-database --dba root --prompt-for-dba-password --action upgrade
   In order to create or update your RT database, this script needs to connect to your  mysql instance on as root
   Please specify that user's database password below. If the user has no database
   password, just press return.

   Working with:
   Type:   mysql
   Name:   rt_upgrade
   User:   rt34
   DBA:    root
   Enter RT version you're upgrading from: 3.4.2

 Going to apply following upgrades:
  ... snip ...

Enter RT version if you want to stop upgrade at some point,
   or leave it blank if you want apply above upgrades:


Proceed [y/N]:y
Processing 3.5.1
Now inserting data
Processing 3.7.1
... snip ...
Processing 3.8.2
Now inserting data
[Tue Feb  3 23:29:12 2009] [warning]: Going to add [OLD] prefix to all temlates in approvals queue. If you never used
approvals then you  can delete all these templates with [OLD] prefix. Leave new there may be you will want to use approvals
some time. (./etc/upgrade/3.8.2/content:3) [Tue Feb  3 23:29:14 2009] [warning]: IMPORTANT: We're going to delete all
scrips in Approvals queue and save them in 'rt-approvals-scrips-zgcD' file. (./etc/upgrade/3.8.2/content:165)
  • If it doesn't error you're golden! If it does, restore your DB and start over.
  • OK. Now we apply the upgraded code:
[usr/local/src/rt-3.8.2]# make upgrade
  • We had to move all of our old customizations out of the way and then rm the original dirs as they were trashing the new layout
[usr/local/src/rt-3.8.2]# cd /usr/local/rt3/local/
[/usr/local/rt3/local/]# cp -pR html html.rt34
[/usr/local/rt3/local/]# cp -pR lib lib.rt34
[/usr/local/rt3/local/]# rm -R html/*
[/usr/local/rt3/local/]# rm -R lib/*
  • Time to tweak Apache. We're moving from running RT with /mod_perl/ to /fastcgi/. First we have to install that:
[/]# cd /usr/ports/www/mod_fastcgi
[/usr/ports/www/mod_fastcgi]# make install

  ... snip....

  * Fast-cgi modules was included with your apache           *
  * configuration file                                       *
  *                                                          *
  * You need to add following lines to your apache           *
  * configuration file. and restart it !                     *
  *                                                          *
  * AddHandler fastcgi-script fcgi fcgi fpl                  *
  *                                                          *
  ===>   Registering installation for mod_fastcgi-2.4.2
  • we also need the FCGI perl module now that we have fastcgi built:
[/usr/local/src/]# wget
[/usr/local/src/]# tar zxvf FCGI-0.67.tar.gz
[/usr/local/src/FCGI-0.67/]# cd FCGI-0.67
[/usr/local/src/FCGI-0.67/]# perl Makefile.PL
[/usr/local/src/FCGI-0.67/]# make install
  • Now tweak the Apache conf file:
[/usr/local/rt3/local/]# cp /usr/local/apache/conf/httpd.conf /usr/local/apache/conf/httpd.conf.preupgrade
[/usr/local/rt3/local/]# vi /usr/local/apache/conf/httpd.conf
  • Comment out the following lines:
#  PerlModule Apache::DBI
  #  PerlRequire /usr/local/rt3/bin/
  #  SetHandler perl-script
  #  PerlHandler RT::Mason
  • Add the following lines:
LoadModule fastcgi_module     libexec/                                (in upper section next to other LoadModule's )
FastCgiServer /usr/local/rt3/bin/mason_handler.fcgi -idle-timeout 120 -processes 4  (right under above line)
ScriptAlias / /usr/local/rt3/bin/mason_handler.fcgi/                                (right after the DocumentRoot statement)
  • Restart Apache and give it a whirl
  • If Apache refuses to start, check the error logs

Worked for me. Good luck -Steffan