Upgrading RT3 to RT4 on Ubuntu 10.04 64bit LTS


A new major release of Best Practical’s fantastic Issue Management System, Request Tracker, has been released in its fourth version! Hooray!

The purpose of this article is to share my experiences how I upraded Request Tracker from version 3.8.7 to 4.0.1 on an Ubuntu 10.04 LTS server.

Why upgrade? Nicer, cleaner and easier web interface, but first and foremost because of the mobile interface!

Here’s an overview of the necessary steps:

  • Step 0/8: Backup your  DB
  • Step 1/8: Get the code
  • Step 2/8: Read the docs
  • Step 3/8: Install the binaries
  • Step 4/8: Configure RT4
  • Step 5/8: Upgrade the RT Database
  • Step 6/8: Actions from docs/UPGRADING-3.8
  • Step 7/8: Actions from docs/UPGRADING-4.0
  • Step 8/8: Configure a connector for Apache2
Notes

Note 1: It is not clear in the RT4 documentation, that any relative directory reference is relative to the untarred source directory. In other words, for any command that uses a relative directory reference in the official RT4 documentation, you must cd to the root of the untarred source.

Note 2: According to Ubuntuupdates.org, RT4 will be available for Ubuntu Oneiric Ocelot (11.10), and I guess that it will be available for the 10.04 LTS via the backports repository shortly after that.

Until then, this is how to do it.

Step 0/8: backup your DB

I run RT on PostgreSQL, so backing up my DB is done like this:

# sudo -u postgres /usr/bin/pg_dumpall > /var/db_dumps/postgresql.dump

For your convenience, here’s the command to dump MySQL:

# mysqldump -h localhost -P 3306 -u root --lock-all-tables \
--all-databases > /var/db_dumps/mysql.sql

Step 1/8: Get the code

# cd /usr/local/src \
&& wget http://download.bestpractical.com/pub/rt/release/rt-4.0.1.tar.gz
# tar zxvf  rt-4.0.1.tar.gz

Step 2/8: Read the docs

I am upgrading from 3.8.7, which means that I have to read the following docs (in this order):

  1. rt-4.0.1/README
  2. rt-4.0.1/docs/UPGRADING-3.8
  3. rt-4.0.1/docs/UPGRADING-4.0

Step 3/8: Install the binaries

First, compile the code:

# ./configure --enable-graphviz --enable-gd --enable-gpg \
            --with-web-user=www-data --with-web-group=www-data \
            --with-db-type=Pg --with-db-dba=postgres

All other default values are OK.

Ensure that you have configured perl with CPAN:

# /usr/bin/perl -MCPAN -e shell

Next, make and install the upgrade:

# make testdeps && make  fixdeps

And answer YES to all. Next, ensure that all dependencies are OK:

# make testdeps

And finally install

# make upgrade

Note: The installation directory for your RT4 is in /opt/rt4

Step 4/8: Configure RT4

Edit the /opt/rt4/RT_SiteConfig.pm file to match /etc/request-tracker3.8/RT_SiteConfig.pm.

This is my RT_SiteConfig.pm:

# THE BASICS:
Set($rtname, 'pandora');
Set($Organization, 'ZH');

Set($CorrespondAddress , 'rt@zaera-holo.net');
Set($CommentAddress , 'rt-comment@zaera-holo.net');

# THE WEBSERVER:
Set($WebPath , "/rt");
Set($WebBaseURL , "http://intranet.zaera-holo.net");

# THE DATABASE:
# map from dbconfig-common database types to their names as known by RT
my %typemap = (
    mysql   => 'mysql',
    pgsql   => 'Pg',
    sqlite3 => 'SQLite',
);

Set($DatabaseType, $typemap{pgsql} || "UNKNOWN");

Set($DatabaseHost, 'localhost');
Set($DatabasePort, '');

Set($DatabaseUser , '<INSERT YOUR EXISTING RTDB USERNAME HERE>');
Set($DatabasePassword , '<INSERT YOUR PASSWORD HERE>');

# SQLite needs a special case, since $DatabaseName must be a full pathname
my $dbc_dbname = 'rtdb'; \
if ( "pgsql" eq "sqlite3" ) { Set ($DatabaseName, '' . '/' . $dbc_dbname); } \
else { Set ($DatabaseName, $dbc_dbname); }

# Enable RT4 to detect addresses on the Cc and add them to the ticket.
Set($ParseNewMessageForTicketCcs, 1);
Set($RTAddressRegexp , '^rt@zaera-holo.net$');

# DEPRECATED, use lifecycle 'default' instedad
# Set(@ActiveStatus, qw(new open finished stalled));

# Lifecycle definitions
default => {
    active   => ['new', 'open', 'stalled', 'finished']
};

Step 5/8: Upgrade the Database

Now, run the patches.

# cd /usr/local/src/rt-4.0.1
# /opt/rt4/sbin/rt-setup-database --prompt-for-dba-password --action upgrade

You will see the following error message, unless you’re standing in the untarred source directory:

ERROR: Couldn't read dir './etc/upgrade' with upgrade data

You must cd to where you untarred your RT4 source (I did this in /usr/local/src/rt/4.0.1/)

My upgrade stopped suddenly while processing the 3.9.3 patch:

Failed to connect to dbi:Pg:dbname=rtdb;host=localhost as user 'postgres':
fe_sendauth: no password supplied

Ensure to have a password for your postgres user in your postgres DBMS, and type it in when prompted for it. To continue the upgrade, I ensured to continue from the last successful patch:

Enter RT version you're upgrading from: 3.9.2

Step 6/8: Actions from UPGRADING-3.8

Upgrade passwords:

# cd /usr/local/src/rt-4.0.1
# perl etc/upgrade/vulnerable-passwords --fix

Delete unneccessary transactions:

# cd /usr/local/src/rt-4.0.1
# perl -I /opt/rt4/local/lib \
-I /opt/rt4/lib etc/upgrade/shrink_transactions_table.pl

Step 7/8: Actions from UPGRADING-4.0

None for me🙂

Step 8/8: Create connector for Apache2

I use modperl, so I created /opt/rt4/etc/apache2-modperl2.conf and made it look like this:

### Optional apache logs for RT
ErrorLog /opt/rt4/var/log/apache2.error
TransferLog /opt/rt4/var/log/apache2.access
# LogLevel debug

AddDefaultCharset UTF-8

#DocumentRoot "/opt/rt4/share/html"
<Location /rt>
    Order allow,deny
    Allow from all

    SetHandler modperl
    PerlResponseHandler Plack::Handler::Apache2
    PerlSetVar psgi_app /opt/rt4/sbin/rt-server
</Location>
<Perl>
    use Plack::Handler::Apache2;
    Plack::Handler::Apache2->preload("/opt/rt4/sbin/rt-server");
</Perl>

Add the following line to your apache config:

Include "/opt/rt4/etc/apache2-modperl2.conf"

Reload your apache config:

# service apache2 reload

Now, browse to the RT4 web interface, and log in. Everything looks good!🙂

9 thoughts on “Upgrading RT3 to RT4 on Ubuntu 10.04 64bit LTS

  1. Getting this error when starting httpd, would anyone be able to help?

    service httpd configtest

    Can’t locate Plack/Handler/Apache2.pm in @INC (@INC contains: /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8 . /etc/httpd) at /opt/rt4/etc/apache2-modperl2.conf line 18.\nBEGIN failed–compilation aborted\t(in cleanup) Can’t locate Plack/Handler/Apache2.pm in @INC (@INC contains: /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8 . /etc/httpd) at /opt/rt4/etc/apache2-modperl2.conf line 18.\nBEGIN failed–compilation aborted at /opt/rt4/etc/apache2-modperl2.conf line 18.\n

  2. Hi I am having the same problem and yes I have performed make testdeps && make fixdeps and ive traced it back to a problem with plack erroring out – with
    Result: FAIL
    Failed 16/114 test programs. 0/435 subtests failed.
    make: *** [test_dynamic] Error 2
    MIYAGAWA/Plack-0.9985.tar.gz
    /usr/bin/make test — NOT OK
    //hint// to see the cpan-testers results for installing this module, try:
    reports MIYAGAWA/Plack-0.9985.tar.gz
    Running make install
    make test had returned bad status, won’t install without force

  3. I olved part of the problem.
    Plack is installed the problem is following from perl it say following:
    cpan[1]> i Plack::Handler::Apache2
    Module id = Plack::Handler::Apache2
    CPAN_USERID MIYAGAWA (Tatsuhiko Miyagawa )
    CPAN_VERSION undef
    CPAN_FILE M/MI/MIYAGAWA/Plack-0.9982.tar.gz
    MANPAGE Plack::Handler::Apache2 – Apache 2.0 handlers to run PSGI application
    INST_FILE /usr/local/lib/perl5/site_perl/5.13.9/Plack/Handler/Apache2.pm
    INST_VERSION undef

    but apache says that @INC the INST_FILE is not found because /usr/local/lib/perl5/site_perl/5.13.9 is not included so i try adding in my apache2 zone:

    use lib ‘/usr/local/lib/perl5/site_perl/5.13.9’;

    At the end my apache2 zone ended like this:

    use lib ‘/usr/local/lib/perl5/site_perl/5.13.9’;
    use Plack::Handler::Apache2;
    Plack::Handler::Apache2->preload(«/opt/rt4/sbin/rt-server»);

    But then another error shows up:

    Stopping web server: apache2[Thu Aug 25 03:04:30 2011] [warning]: (in cleanup) Error while loading /opt/rt4/sbin/rt-server: Can’t locate loadable object for module Devel::GlobalDestruction in @INC (@INC contains: /opt/rt4/sbin/../local/lib /opt/rt4/sbin/../lib /usr/local/lib/perl5/site_perl/5.13.9 /etc/perl /usr/local/lib/perl/5.10.0 /usr/local/share/perl/5.10.0 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl . /etc/apache2) at /opt/rt4/sbin/../lib/RT/Ticket.pm line 84
    Compilation failed in require at /opt/rt4/sbin/../lib/RT/Ticket.pm line 84.
    BEGIN failed–compilation aborted at /opt/rt4/sbin/../lib/RT/Ticket.pm line 84.
    Compilation failed in require at /opt/rt4/sbin/../lib/RT/Tickets.pm line 85.
    BEGIN failed–compilation aborted at /opt/rt4/sbin/../lib/RT/Tickets.pm line 85.
    Compilation failed in require at /opt/rt4/sbin/../lib/RT.pm line 395. (/opt/rt4/sbin/../lib/RT.pm:342)

    Then i am stuck here also i test in perl:

    cpan[2]> i Devel::GlobalDestruction
    Module id = Devel::GlobalDestruction
    CPAN_USERID FLORA (Florian Ragwitz )
    CPAN_VERSION 0.04
    CPAN_FILE F/FL/FLORA/Devel-GlobalDestruction-0.04.tar.gz
    UPLOAD_DATE 2011-07-03
    MANPAGE Devel::GlobalDestruction – Expose PL_dirty, the flag which marks global destruction.
    INST_FILE /usr/local/lib/perl5/site_perl/5.13.9/Devel/GlobalDestruction.pm
    INST_VERSION 0.04

    The package is there so i do not know where is missing this problem. Also i tried to add lib in every perl script of RT4 but not success the package is not found.

    Any idea?

  4. CONFIG:

    ServerName rt.wi-tribe.net.pk
    DocumentRoot /opt/rt4/share/html

    ErrorLog /opt/rt4/var/log/apache2.error
    TransferLog /opt/rt4/var/log/apache2.access
    # LogLevel debug

    AddDefaultCharset UTF-8

    PerlSetEnv RT_SITE_CONFIG /opt/rt4/etc/RT_SiteConfig.pm
    RedirectMatch permanent (.*)/$ $1/index.html

    DocumentRoot /opt/rt4/share/html

    Order allow,deny
    Allow from all

    SetHandler modperl
    PerlResponseHandler Plack::Handler::Apache2
    PerlSetVar psgi_app /opt/rt4/sbin/rt-server

    use Plack::Handler::Apache2;
    Plack::Handler::Apache2-preload(«/opt/rt4/sbin/rt-server»);

    ERROR:
    Syntax error on line 24 of /etc/apache2/sites-enabled/rt.wi-tribe.net.pk:
    Can’t locate Plack/Handler/Apache2.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.10.1 /usr/local/share/perl/5.10.1 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl . /etc/apache2) at /etc/apache2/sites-enabled/rt.wi-tribe.net.pk line 24.\nBEGIN failed–compilation aborted\t(in cleanup) Can’t locate Plack/Handler/Apache2.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.10.1 /usr/local/share/perl/5.10.1 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl . /etc/apache2) at /etc/apache2/sites-enabled/rt.wi-tribe.net.pk line 24.\nBEGIN failed–compilation aborted at /etc/apache2/sites-enabled/rt.wi-tribe.net.pk line 24.\n
    …fail!

Legg igjen en kommentar

Fyll inn i feltene under, eller klikk på et ikon for å logge inn:

WordPress.com-logo

Du kommenterer med bruk av din WordPress.com konto. Logg ut / Endre )

Twitter picture

Du kommenterer med bruk av din Twitter konto. Logg ut / Endre )

Facebookbilde

Du kommenterer med bruk av din Facebook konto. Logg ut / Endre )

Google+ photo

Du kommenterer med bruk av din Google+ konto. Logg ut / Endre )

Kobler til %s