Il sistema di help desk utilizzato nella società in cui ho effettuato questo lavoro è basato su Request Tracker della BestPractical.
Fino a ieri era in produzione su un box Linux Red-hat FedoraCore2 con la release di RT 3.0.10
Da oggi è in esecuzione su un box linux con distro Debian 4.0.
Usa mysql5, perl 5, apache2 e FastCgi. Il sistema di posta è exim4. La versione di RT è l'ultima pacchettizata disponibile per debian: la 3.6.1
Si è trattato quindi di preservare gli oltre 1200Mb di dati sql relativi allo storico dell'help desk, spostarei dati e far ripartire il tutto nel nuovo ambiente.
Per i curiosi segue un brain dump del lavoro svolto.
Creazione dell'utente mysql con opportuni privilegi per il db di rt.
GRANT ALL PRIVILEGES ON rt3.* TO rt_userxxxx@localhost IDENTIFIED BY 'xxxxx';
Configurazione di exim4
echo "SYSTEM_ALIASES_PIPE_TRANSPORT = address_pipe" >> /etc/exim4/conf.d/main/90_exim4-config_requesttracker
Aggiunte al file /etc/exim4/exim4.conf.template prima della sezione begin acl le seguenti istruzioni:
ifndef SYSTEM_ALIASES_PIPE_TRANSPORT
SYSTEM_ALIASES_PIPE_TRANSPORT = address_pipe
endif
Cosnentire al servzio apache di leggere il file di configurazione di RT
******************************************************
cd /etc/request-tracker3.6/
cp -p RT_SiteConfig.pm RT_SiteConfig.pm.ori
chgrp www-data RT_SiteConfig.pm
chmod 640 RT_SiteConfig.pm
**************************************************************
Stoppato sul vecchio sistema
sendmail
apache
Eseguito il dump del db con:
mysqldump –user=rt_userxxxx –password=xxxx –opt –databases rt3 > /usr/tempdb/rt.sql
(impiegati circa 7 minuti)
Copiato il file sulla nuova macchina con
scp rt.sql root@xxx.yyy.it:/root
(circa 2 minuti)
**************************************************************
mysqladmin –user=root –password=yyyyy drop rt3
mysql –user=root –pasword=yyyyy < rt.sql
Impiegati circa 3 minuti
Applico i cambiamenti allo schema, ai permessi e ai dati:
cd /etc/request-tracker3.6/
for action in schema acl insert; do rt-setup-database –dba root –dba-password=yyyyy –action $action –datadir upgrade/3.1.0; done
for action in schema acl insert; do rt-setup-database –dba root –dba-password=yyyyy –action $action –datadir upgrade/3.1.15; done
for action in schema acl insert; do rt-setup-database –dba root –dba-password=yyyyy –action $action –datadir upgrade/3.1.17; done
for action in schema acl insert; do rt-setup-database –dba root –dba-password=yyyyy –action $action –datadir upgrade/3.3.0; done
for action in schema acl insert; do rt-setup-database –dba root –dba-password=yyyyy –action $action –datadir upgrade/3.3.11; done
for action in schema acl insert; do rt-setup-database –dba root –dba-password=yyyyy –action $action –datadir upgrade/3.5.1; done
Eseguito il truncate della tabella session di rt3 che occupava circa 690Mb.
Modifiche interfaccia:
cambio del logo e del footer
Aggiunti i file Logo e Footer (copiati) da location originaria in
/usr/local/share/request-tracker3.6/html/Elements/
e poi modificati di conseguenza (gli originali si trovano in /usr/share/request-tracker3.6/html/Elements/ )
Modificato il file /etc/request-tracker3.6/RT_SiteConfig.pm aggiungendo in fondo (tali parametri vengono usati nel file Logo di cui sopra):
# THE LOGO
Set($WebImagesURL , $WebPath . "/NoAuth/images/");
Set($LogoLinkURL, 'http://xxxx.yyyyy.it');
Set($LogoImageURL, $WebImagesURL . "logoxxx.gif");
Set($LogoAltText, "testo xxx yyyy");
Set($LogoWidth, '273');
Set($LogoHeight, '71');
Aggiunto il file logofast.gif nella dir /usr/share/request-tracker3.6/html/NoAuth/images/
***************Gestione della visualizzazione e delle modifiche dei campi custom durante la risposta ad un messaggio.
Place the following text in the file /usr/local/share/request-tracker3.6/html/Callbacks/CustomFields/Ticket/Update.html/BeforeMessageBox
<%init>
my $Ticket = LoadTicket($ARGS{'id'});
</%init>
<& /Ticket/Elements/EditCustomFields, TicketObj => $Ticket &>
RT3.6 introduced an additional HTML redirect in Display.html which made the above method fail. For 3.6 you should put this in the file /usr/local/share/request-tracker3.6/html/Callbacks/CustomFields/Ticket/Display.html/BeforeDisplay
<%init>
my $ARGSRef = $ARGS{'ARGSRef'};
if ($$ARGSRef{'id'} ne 'new'){
my $Ticket = LoadTicket($$ARGSRef{'id'});
my @cf_results = ProcessObjectCustomFieldUpdates(ARGSRef => $ARGSRef);
delete $cf_results[0] if ((scalar(@cf_results) == 1) && ($cf_results[0] eq ''));
push @{$ARGS{Actions}}, @cf_results;
}
</%init>
<%args>
$Actions => []
</%args>
As of 07/26/2006 there seems to be a slight error/problem in ProcessObjectCustomFieldUpdates that will return an empty element in the @cf_results array even if it did not do anything. This might lead to loops in Display.html on some perl versions. Hence the "delete" line.
Moreover you will need to adjust /usr/local/share/request-tracker3.6/html/Ticket/Display.html. At the end it should read
$m->comp('/Elements/Callback', _CallbackName => 'BeforeDisplay',
TicketObj => \$TicketObj, Tickets => \$Tickets, ARGSRef => \%ARGS, Actions => \@Actions );
if (@Actions) {
# We've done something, so we need to clear the decks to avoid
# resubmission on refresh.
# But we need to store Actions somewhere too, so we don't lose them.
$session{"Actions"} = \@Actions;
$m->redirect($RT::WebURL."Ticket/Display.html?id=".$TicketObj->id);
} else {
@Actions = @{$session{"Actions"} || [] };
delete $session{"Actions"};
}
my $attachments = $m->comp('Elements/FindAttachments', Ticket => $TicketObj, Tickets => $Tickets);
Note that the Callback call has been moved in front of the if and has been changed to include "Actions".
***************FINE Gestione della visualizzazione e delle modifiche dei campi custom durante la risposta ad un messaggio.
Completata la traduzione del file it.po e piazzato il nuovo file in /usr/local/share/request-tracker3.6/po/it.po
Per generare le stringhe mancanti ho prelevato il file extract-message-catalog dalla directory sbin del pacchetto sorgente.
Ho posizionato tale file nella directory /usr/share/request-tracker3.6 insieme ad una copia del file /usr/share/request-tracker3.6/lib/RT/I18N/it.po
Poi ho eseguito
chmod +x extract-message-catalog
./extract-message-catalog it.po
(Scandisce la struttura di file di RT e genera le stringhe mancanti da tradurre [quelle già tradotte le lascia])
Ho poi eleborato il file con il tool per windows poEdit prelevabile da http://www.poedit.org