Database Upgrade Errors -- Please Help

Gentle Greetings,

We are in the process of upgrading from RT 3.0.0 to RT 3.4.4. We have set
up a new server with a fresh install of Apache (dynamic), MySQL, and RT,
all located in a separate filesystem for RT. I did a database dump from
our production system and imported it into the new system. Then I ran all
of the needed database upgrade scripts.

There were errors on some of the database upgrade scripts, and data is
clearly missing from the RT display in the web interface (for example,
Custom Fields). I have included the output from running the database
scripts below. Any help would be greatly appreciated. I have searched the
Wiki and mail list archives and found similar threads but no solutions.

Thank you in advance for any assistance!
Jennifer

Here is information about the setup of our new server:

OS,Distribution – Red Hat Enterprise Linux AS release 3 (Taroon Update 5)
Linux hostname.edu 2.4.21-32.0.1.ELsmp #1 SMP Tue May 17 17:52:23 EDT 2005
i686 i686 i386 GNU/Linux
RT Version – URL: svn://svn.bestpractical.com/rt/branches/3.4-RELEASE
Repository UUID: e417ac7c-1bcc-0310-8ffa-8f5827389a85
Revision: 4108
Perl Version – v5.8.6 built for i686-linux
HTML::Mason – 1.3101
DBIx::SearchBuilder Version – 1.35
Apache Version – Apache/1.3.33 (Unix) Server built: Nov 3 2005 10:58:25
mod_perl Version – 1.29
mod_ssl Version – 2.8.22-1.3.33
MySQL Version – ./mysql Ver 14.7 Distrib 4.1.11, for pc-linux-gnu (i686)
C Compiler Version – GNU cc 3.2.3 20030502 (Red Hat Linux 3.2.3-49)

Here is the output from running the database upgrade scripts:

[user@HOST ./rt-3.4.4/]>

[user@HOST ./rt-3.4.4/]> ls etc/upgrade/
3.1.0 3.1.15 3.1.17 3.3.0 3.3.11

[user@HOST ./rt-3.4.4/]> sudo /rt/apps/rt/rt-3.4.4/sbin/rt-setup-database
–dba dbauser --prompt-for-dba-password --action schema --datadir
etc/upgrade/3.1.0
In order to create or update your RT database,this script needs to connect
to your mysql instance on localhost as dbauser.
Please specify that user’s database password below. If the user has no database
password, just press return.

Password:
Creating database schema.
Problem with statement:

CREATE TABLE Attributes (
id INTEGER NOT NULL AUTO_INCREMENT,
Name varchar(255) NULL ,
Description varchar(255) NULL ,
Content text,
ContentType varchar(16),
ObjectType varchar(64),
ObjectId integer,
Creator integer NOT NULL DEFAULT 0 ,
Created DATETIME NULL ,
LastUpdatedBy integer NOT NULL DEFAULT 0 ,
LastUpdated DATETIME NULL ,
PRIMARY KEY (id)
) TYPE=InnoDB
Table ‘Attributes’ already exists at
/rt/apps/rt/rt-3.4.4/sbin/rt-setup-database line 205.

[user@HOST ./rt-3.4.4/]> sudo /rt/apps/rt/rt-3.4.4/sbin/rt-setup-database
–dba dbauser --prompt-for-dba-password --action acl --datadir
etc/upgrade/3.1.0
In order to create or update your RT database,this script needs to connect
to your mysql instance on localhost as dbauser.
Please specify that user’s database password below. If the user has no database
password, just press return.

Password:
Done setting up database ACLs.

[user@HOST ./rt-3.4.4/]> sudo /rt/apps/rt/rt-3.4.4/sbin/rt-setup-database
–dba dbauser --prompt-for-dba-password --action insert --datadir
etc/upgrade/3.1.0
In order to create or update your RT database,this script needs to connect
to your mysql instance on localhost as dbauser.
Please specify that user’s database password below. If the user has no database
password, just press return.

Password:
Done setting up database content.

[user@HOST ./rt-3.4.4/]> sudo /rt/apps/rt/rt-3.4.4/sbin/rt-setup-database
–dba dbauser --prompt-for-dba-password --action schema --datadir
etc/upgrade/3.1.15
In order to create or update your RT database,this script needs to connect
to your mysql instance on localhost as dbauser.
Please specify that user’s database password below. If the user has no database
password, just press return.

Password:
Creating database schema.
Couldn’t find schema file for mysql

[user@HOST ./rt-3.4.4/]> sudo /rt/apps/rt/rt-3.4.4/sbin/rt-setup-database
–dba dbauser --prompt-for-dba-password --action acl --datadir
etc/upgrade/3.1.15
In order to create or update your RT database,this script needs to connect
to your mysql instance on localhost as dbauser.
Please specify that user’s database password below. If the user has no database
password, just press return.

Password:
Couldn’t find ACLS for mysql in etc/upgrade/3.1.15

[user@HOST ./rt-3.4.4/]> sudo /rt/apps/rt/rt-3.4.4/sbin/rt-setup-database
–dba dbauser --prompt-for-dba-password --action insert --datadir
etc/upgrade/3.1.15
In order to create or update your RT database,this script needs to connect
to your mysql instance on localhost as dbauser.
Please specify that user’s database password below. If the user has no database
password, just press return.

Password:
Creating scrips…127.done.
Done setting up database content.

[user@HOST ./rt-3.4.4/]> sudo /rt/apps/rt/rt-3.4.4/sbin/rt-setup-database
–dba dbauser --prompt-for-dba-password --action schema --datadir
etc/upgrade/3.1.17
In order to create or update your RT database,this script needs to connect
to your mysql instance on localhost as dbauser.
Please specify that user’s database password below. If the user has no database
password, just press return.

Password:
Creating database schema.
Couldn’t find schema file for mysql

[user@HOST ./rt-3.4.4/]> sudo /rt/apps/rt/rt-3.4.4/sbin/rt-setup-database
–dba dbauser --prompt-for-dba-password --action acl --datadir
etc/upgrade/3.1.17
In order to create or update your RT database,this script needs to connect
to your mysql instance on localhost as dbauser.
Please specify that user’s database password below. If the user has no database
password, just press return.

Password:
Couldn’t find ACLS for mysql in etc/upgrade/3.1.17

[user@HOST ./rt-3.4.4/]> sudo /rt/apps/rt/rt-3.4.4/sbin/rt-setup-database
–dba dbauser --prompt-for-dba-password --action insert --datadir
etc/upgrade/3.1.17
In order to create or update your RT database,this script needs to connect
to your mysql instance on localhost as dbauser.
Please specify that user’s database password below. If the user has no database
password, just press return.

Password:
Creating ScripActions…18.19.done.
Creating ScripConditions…11.done.
Done setting up database content.

[user@HOST ./rt-3.4.4/]> sudo /rt/apps/rt/rt-3.4.4/sbin/rt-setup-database
–dba dbauser --prompt-for-dba-password --action schema --datadir
etc/upgrade/3.3.0
In order to create or update your RT database,this script needs to connect
to your mysql instance on localhost as dbauser.
Please specify that user’s database password below. If the user has no database
password, just press return.

Password:
Creating database schema.
Problem with statement:
alter Table Transactions ADD Column (ObjectType varchar(64) not null)
Duplicate column name ‘ObjectType’ at
/rt/apps/rt/rt-3.4.4/sbin/rt-setup-database line 205.

[user@HOST ./rt-3.4.4/]> sudo /rt/apps/rt/rt-3.4.4/sbin/rt-setup-database
–dba dbauser --prompt-for-dba-password --action acl --datadir
etc/upgrade/3.3.0
In order to create or update your RT database,this script needs to connect
to your mysql instance on localhost as dbauser.
Please specify that user’s database password below. If the user has no database
password, just press return.

Password:
Done setting up database ACLs.

[user@HOST ./rt-3.4.4/]> sudo /rt/apps/rt/rt-3.4.4/sbin/rt-setup-database
–dba dbauser --prompt-for-dba-password --action insert --datadir
etc/upgrade/3.3.0
In order to create or update your RT database,this script needs to connect
to your mysql instance on localhost as dbauser.
Please specify that user’s database password below. If the user has no database
password, just press return.

Password:
Done setting up database content.

[user@HOST ./rt-3.4.4/]> sudo /rt/apps/rt/rt-3.4.4/sbin/rt-setup-database
–dba dbauser --prompt-for-dba-password --action schema --datadir
etc/upgrade/3.3.11
In order to create or update your RT database,this script needs to connect
to your mysql instance on localhost as dbauser.
Please specify that user’s database password below. If the user has no database
password, just press return.

Password:
Creating database schema.
Problem with statement:
ALTER TABLE ObjectCustomFieldValues ADD COLUMN SortOrder INTEGER NOT NULL
DEFAULT 0
Duplicate column name ‘SortOrder’ at
/rt/apps/rt/rt-3.4.4/sbin/rt-setup-database line 205.

[user@HOST ./rt-3.4.4/]> sudo /rt/apps/rt/rt-3.4.4/sbin/rt-setup-database
–dba dbauser --prompt-for-dba-password --action acl --datadir
etc/upgrade/3.3.11
In order to create or update your RT database,this script needs to connect
to your mysql instance on localhost as dbauser.
Please specify that user’s database password below. If the user has no database
password, just press return.

Password:
Done setting up database ACLs.

[user@HOST ./rt-3.4.4/]> sudo /rt/apps/rt/rt-3.4.4/sbin/rt-setup-database
–dba dbauser --prompt-for-dba-password --action insert --datadir
etc/upgrade/3.3.11
In order to create or update your RT database,this script needs to connect
to your mysql instance on localhost as dbauser.
Please specify that user’s database password below. If the user has no database
password, just press return.

Password:
Done setting up database content.

[user@HOST ./rt-3.4.4/]>

At Monday 11/21/2005 11:04 AM, Jennifer I. Moore wrote:

Gentle Greetings,

We are in the process of upgrading from RT 3.0.0 to RT 3.4.4. We have set
up a new server with a fresh install of Apache (dynamic), MySQL, and RT,
all located in a separate filesystem for RT. I did a database dump from
our production system and imported it into the new system. Then I ran all
of the needed database upgrade scripts.

There were errors on some of the database upgrade scripts, and data is
clearly missing from the RT display in the web interface (for example,
Custom Fields). I have included the output from running the database
scripts below. Any help would be greatly appreciated. I have searched
the Wiki and mail list archives and found similar threads but no solutions.

Thank you in advance for any assistance!
Jennifer

Hello Jennifer,

You didn’t mention what version of RT you installed on the new server. If
it’s 3.4.4 that would account for the errors in the database upgrade
scripts - the changes it was trying to make are already in place.

I’m not sure of the exact upgrade path from 3.0 to 3.4, but I think
generally speaking you should start with a replica of your older system and
let the RT upgrade scripts take care of bringing the database up to the
latest version rather than installing 3.4.4 and importing your old database.

Steve

At 11/21/2005 12:33 PM, you wrote:

Hello Jennifer,

You didn’t mention what version of RT you installed on the new server. If
it’s 3.4.4 that would account for the errors in the database upgrade
scripts - the changes it was trying to make are already in place.

I’m not sure of the exact upgrade path from 3.0 to 3.4, but I think
generally speaking you should start with a replica of your older system
and let the RT upgrade scripts take care of bringing the database up to
the latest version rather than installing 3.4.4 and importing your old
database.

Steve

Hi Steve,

Thank you for the reply. Our old (currently production) server has old
versions of MySQL, Apache, and RT (3.0.0). Also, it is a static build,
with many parts relying on system shared libraries. The new server has
everything in its own filesystem on a SAN, with upgraded versions of all of
the parts. So, it is not really possible to just use the old stuff.

In a sense, we are creating a “replica” on the new server, just with newer
versions of the software pieces. The MySQL import puts the old database in
place on the new server. Then I run make upgrade instead of make install
for RT. But the db upgrade scripts are not all working. The new RT is
online, but pieces are not displayed. The db dump from the old system
shows all the data.

Thanks again Steve.

Jennifer

Jennifer I. Moore wrote:

At 11/21/2005 12:33 PM, you wrote:

Hello Jennifer,

You didn’t mention what version of RT you installed on the new
server. If it’s 3.4.4 that would account for the errors in the
database upgrade scripts - the changes it was trying to make are
already in place.

I’m not sure of the exact upgrade path from 3.0 to 3.4, but I think
generally speaking you should start with a replica of your older
system and let the RT upgrade scripts take care of bringing the
database up to the latest version rather than installing 3.4.4 and
importing your old database.

Steve

Hi Steve,

Thank you for the reply. Our old (currently production) server has
old versions of MySQL, Apache, and RT (3.0.0). Also, it is a static
build, with many parts relying on system shared libraries. The new
server has everything in its own filesystem on a SAN, with upgraded
versions of all of the parts. So, it is not really possible to just
use the old stuff.

In a sense, we are creating a “replica” on the new server, just with
newer versions of the software pieces. The MySQL import puts the old
database in place on the new server. Then I run make upgrade instead
of make install for RT.

If you don’t have an old version of RT installed, wouldn’t you need to
do a make install instead of make upgrade? Or am I understanding you wrong?

But the db upgrade scripts are not all working. The new RT is online,
but pieces are not displayed. The db dump from the old system shows
all the data.

Thanks again Steve.

Jennifer


The rt-users Archives

Be sure to check out the RT Wiki at http://wiki.bestpractical.com

Download a free sample chapter of RT Essentials from O’Reilly Media at
http://rtbook.bestpractical.com

WE’RE COMING TO YOUR TOWN SOON - RT Training in Amsterdam, Boston and
San Francisco - Find out more at
http://bestpractical.com/services/training.html

Drew Barnes
Applications Analyst
Raymond Walters College
University of Cincinnati

At 11/21/2005 04:03 PM, you wrote:

In a sense, we are creating a “replica” on the new server, just with
newer versions of the software pieces. The MySQL import puts the old
database in place on the new server. Then I run make upgrade instead of
make install for RT.

If you don’t have an old version of RT installed, wouldn’t you need to do
a make install instead of make upgrade? Or am I understanding you wrong?

Hi Drew,

New version of RT (3.4.4) + database from old version of RT (3.0.0).

We’ve tried it several different ways… make install, make upgrade, db
upgrade scripts…

We haven’t yet taken the route of installing RT 3.0.0 on the new server,
importing the production db from the old server, and then running make
upgrade to RT 3.4.4 on both the RT install and the database… is that
what needs to happen?

Guess I was hoping to be able to bring just the old (3.0.0) database up to
speed with the new install of 3.4.4 rather than having to install the old
RT as well.

In this latter scenerio, would it be make install or make upgrade? It
wasn’t clear to us.

Thanks in advance,
Jennifer

At Monday 11/21/2005 04:15 PM, Jennifer I. Moore wrote:

We haven’t yet taken the route of installing RT 3.0.0 on the new server,
importing the production db from the old server, and then running make
upgrade to RT 3.4.4 on both the RT install and the database… is that
what needs to happen?

Hi Jennifer,

Yes, I think that’s what I was getting at - you need to do just that.

However what I’m not sure about is if there’s a direct one-step upgrade
from 3.0.0 to 3.4.4 or if you have to do in more than one step (e.g. 3.0 →
3.2 and then 3.2 → 3.4).

Steve

Hi,

I want to do a custom condition for a scrip, which will basically be
OnCreate and Requestor address matches “blah” then send the auto reply.

At the moment I have

if ($self->TrasactionObj->Type =~ ‘Create’){
if ($self->TicketObj->RequestorAddresses =~ /dontsend/){
return (undef);
}
if ($self->TicketObj->RequestorAddresses !~ /send/){
return (undef);
}
}else{
return (undef)
}
return(1);

but that seems to be sending the auto reply on every transaction, not just
when the ticket is created.

Im guessing im using the wrongs TransactionObj-> Type

if ($self->TrasactionObj->Type eq ‘Create’ and
$self->TicketObj->RequestorAddresses =~ /send/) {
return 1;
}On Tue, Nov 22, 2005 at 09:46:30AM +1030, Andrew Xenides wrote:

Hi,

I want to do a custom condition for a scrip, which will basically be
OnCreate and Requestor address matches “blah” then send the auto reply.

At the moment I have

if ($self->TrasactionObj->Type =~ ‘Create’){
if ($self->TicketObj->RequestorAddresses =~ /dontsend/){
return (undef);
}
if ($self->TicketObj->RequestorAddresses !~ /send/){
return (undef);
}
}else{
return (undef)
}
return(1);

but that seems to be sending the auto reply on every transaction, not just
when the ticket is created.

Im guessing im using the wrongs TransactionObj-> Type


The rt-users Archives

Be sure to check out the RT Wiki at http://wiki.bestpractical.com

Download a free sample chapter of RT Essentials from O’Reilly Media at http://rtbook.bestpractical.com

WE’RE COMING TO YOUR TOWN SOON - RT Training in Amsterdam, Boston and
San Francisco - Find out more at http://bestpractical.com/services/training.html

Again,

The problem is the transactionobj-type = create that’s causing the issue

The regex part of the scrip works fine

I want to know why its sending on all transactions, not just on the ticket
create part.From: Todd Chapman [mailto:todd@chaka.net]
Sent: Tuesday, November 22, 2005 12:50 PM
To: Andrew Xenides
Subject: Re: [rt-users] Custom onCreate scrip

if ($self->TrasactionObj->Type eq ‘Create’
and
$self->TicketObj->RequestorAddresses =~ /send/
and
$self->TicketObj->RequestorAddresses !~ /dontsend/
) {
return 1;
}
0;

Hi,

Thanks, the reason I have it in 2 separate if statements is that the don’t
send one contains a portion of the send one, hence if its dontsend don’t
send, but if its only send, then send it. If I put send first, it will
match
in both cases.

The problem is the transaction create part, it is sending emails even if
the
priority is updated, or a comment is added where as I only want it when
the
ticket is created.

-----Original Message-----
From: Todd Chapman [mailto:todd@chaka.net]
Sent: Tuesday, November 22, 2005 11:57 AM
To: Andrew Xenides
Cc: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Custom onCreate scrip

if ($self->TrasactionObj->Type eq ‘Create’ and
$self->TicketObj->RequestorAddresses =~ /send/) {
return 1;
}

Hi,

I want to do a custom condition for a scrip, which will basically be
OnCreate and Requestor address matches “blah” then send the auto reply.

At the moment I have

if ($self->TrasactionObj->Type =~ ‘Create’){
if ($self->TicketObj->RequestorAddresses =~ /dontsend/){
return (undef);
}
if ($self->TicketObj->RequestorAddresses !~ /send/){
return (undef);
}
}else{
return (undef)
}
return(1);

but that seems to be sending the auto reply on every transaction, not
just
when the ticket is created.

Im guessing im using the wrongs TransactionObj-> Type


The rt-users Archives

Be sure to check out the RT Wiki at http://wiki.bestpractical.com

Download a free sample chapter of RT Essentials from O’Reilly Media at
http://rtbook.bestpractical.com

WE’RE COMING TO YOUR TOWN SOON - RT Training in Amsterdam, Boston and
San Francisco - Find out more at
http://bestpractical.com/services/training.html

We haven’t yet taken the route of installing RT 3.0.0 on the new server,
importing the production db from the old server, and then running make
upgrade to RT 3.4.4 on both the RT install and the database… is that
what needs to happen?

Guess I was hoping to be able to bring just the old (3.0.0) database up to
speed with the new install of 3.4.4 rather than having to install the old
RT as well.

In this latter scenerio, would it be make install or make upgrade? It
wasn’t clear to us.

I think you should be able to do a make install, then restore the
old database over what the install created, then run all of the
appropriate db upgrade scripts in the etc/upgrade directory as
described in the README.

Les Mikesell
les@futuresource.com

Assuming you’ve cut and pasted fro your scrip,
$self->TrasactionObj should be $self->TransactionObj

Andrew Xenides wrote:

Again,

The problem is the transactionobj-type = create that’s causing the issue

The regex part of the scrip works fine

I want to know why its sending on all transactions, not just on the ticket
create part.

-----Original Message-----
From: Todd Chapman [mailto:todd@chaka.net]
Sent: Tuesday, November 22, 2005 12:50 PM
To: Andrew Xenides
Subject: Re: [rt-users] Custom onCreate scrip

if ($self->TrasactionObj->Type eq ‘Create’
and
$self->TicketObj->RequestorAddresses =~ /send/
and
$self->TicketObj->RequestorAddresses !~ /dontsend/
) {
return 1;
}
0;

Hi,

Thanks, the reason I have it in 2 separate if statements is that the don’t
send one contains a portion of the send one, hence if its dontsend don’t
send, but if its only send, then send it. If I put send first, it will

match

in both cases.

The problem is the transaction create part, it is sending emails even if

the

priority is updated, or a comment is added where as I only want it when

the

ticket is created.

-----Original Message-----
From: Todd Chapman [mailto:todd@chaka.net]
Sent: Tuesday, November 22, 2005 11:57 AM
To: Andrew Xenides
Cc: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Custom onCreate scrip

if ($self->TrasactionObj->Type eq ‘Create’ and
$self->TicketObj->RequestorAddresses =~ /send/) {
return 1;
}

Hi,

I want to do a custom condition for a scrip, which will basically be
OnCreate and Requestor address matches “blah” then send the auto reply.

At the moment I have

if ($self->TrasactionObj->Type =~ ‘Create’){
if ($self->TicketObj->RequestorAddresses =~ /dontsend/){
return (undef);
}
if ($self->TicketObj->RequestorAddresses !~ /send/){
return (undef);
}
}else{
return (undef)
}
return(1);

but that seems to be sending the auto reply on every transaction, not

just

when the ticket is created.

Im guessing im using the wrongs TransactionObj-> Type


The rt-users Archives

Be sure to check out the RT Wiki at http://wiki.bestpractical.com

Download a free sample chapter of RT Essentials from O’Reilly Media at

http://rtbook.bestpractical.com

WE’RE COMING TO YOUR TOWN SOON - RT Training in Amsterdam, Boston and
San Francisco - Find out more at

http://bestpractical.com/services/training.html


The rt-users Archives

Be sure to check out the RT Wiki at http://wiki.bestpractical.com

Download a free sample chapter of RT Essentials from O’Reilly Media at http://rtbook.bestpractical.com

WE’RE COMING TO YOUR TOWN SOON - RT Training in Amsterdam, Boston and
San Francisco - Find out more at http://bestpractical.com/services/training.html

Drew Barnes
Applications Analyst
Raymond Walters College
University of Cincinnati

Hi Les,

Thank you for the reply. We tried the approach you suggest, and ran into
errors while running the db upgrade scripts. The error logs were included
in my original message.

Still hoping someone can give us some clues as to the cause of the errors.

Thanks in advance,
Jennifer

At 11/21/2005 11:17 PM, you wrote:>On Mon, 2005-11-21 at 15:15, Jennifer I. Moore wrote:

We haven’t yet taken the route of installing RT 3.0.0 on the new server,
importing the production db from the old server, and then running make
upgrade to RT 3.4.4 on both the RT install and the database… is that
what needs to happen?

Guess I was hoping to be able to bring just the old (3.0.0) database up to
speed with the new install of 3.4.4 rather than having to install the old
RT as well.

In this latter scenerio, would it be make install or make upgrade? It
wasn’t clear to us.

I think you should be able to do a make install, then restore the
old database over what the install created, then run all of the
appropriate db upgrade scripts in the etc/upgrade directory as
described in the README.


Les Mikesell
les@futuresource.com

Thank you for the reply. We tried the approach you suggest, and ran into
errors while running the db upgrade scripts. The error logs were included
in my original message.

Still hoping someone can give us some clues as to the cause of the errors.

The first error you show:
Table ‘Attributes’ already exists at
/rt/apps/rt/rt-3.4.4/sbin/rt-setup-database line 205.
looks like you didn’t drop the newly created database before loading
the old one.

Les Mikesell
les@futuresource.com

I think you have to do next steps:

  1. get new server
  2. resolve RT 3.4.4 dependencies on the new server
  3. run configure --...; make install this will install RT’s source code
  4. configure RT_SiteConfig
  5. dump DB from the old server and restore it on the new with DB’s
    tool (mysqldump)
  6. create mysql user with credentials the same as in RT_SiteConfig
    (option $DatabaseUser, $DatabasePass). Use mysql tools for this step.
  7. run DB upgrade scripts

NOTE: you don’t need to run make initialize-database on the new
server from 3.4.4 tarball dir, because this will break upgrade
scripts.On 11/21/05, Jennifer I. Moore jim1@cornell.edu wrote:

Gentle Greetings,

We are in the process of upgrading from RT 3.0.0 to RT 3.4.4. We have set
up a new server with a fresh install of Apache (dynamic), MySQL, and RT,
all located in a separate filesystem for RT. I did a database dump from
our production system and imported it into the new system. Then I ran all
of the needed database upgrade scripts.

There were errors on some of the database upgrade scripts, and data is
clearly missing from the RT display in the web interface (for example,
Custom Fields). I have included the output from running the database
scripts below. Any help would be greatly appreciated. I have searched the
Wiki and mail list archives and found similar threads but no solutions.

Thank you in advance for any assistance!
Jennifer


[snip]

Best regards, Ruslan.

Ah, hehe, I cant remember if I cut and paste or rewrote any of it (I did
edit the code after pasting)

But if that is the case, wouldn’t that return false on all accounts and
never send the email?From: Drew Barnes [mailto:barnesaw@ucrwcu.rwc.uc.edu]
Sent: Wednesday, November 23, 2005 12:11 AM
To: Andrew Xenides
Cc: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Custom onCreate scrip

Assuming you’ve cut and pasted fro your scrip,
$self->TrasactionObj should be $self->TransactionObj

Andrew Xenides wrote:

Again,

The problem is the transactionobj-type = create that’s causing the issue

The regex part of the scrip works fine

I want to know why its sending on all transactions, not just on the ticket
create part.

-----Original Message-----
From: Todd Chapman [mailto:todd@chaka.net]
Sent: Tuesday, November 22, 2005 12:50 PM
To: Andrew Xenides
Subject: Re: [rt-users] Custom onCreate scrip

if ($self->TrasactionObj->Type eq ‘Create’
and
$self->TicketObj->RequestorAddresses =~ /send/
and
$self->TicketObj->RequestorAddresses !~ /dontsend/
) {
return 1;
}
0;

Hi,

Thanks, the reason I have it in 2 separate if statements is that the
don’t
send one contains a portion of the send one, hence if its dontsend don’t
send, but if its only send, then send it. If I put send first, it will

match

in both cases.

The problem is the transaction create part, it is sending emails even if

the

priority is updated, or a comment is added where as I only want it when

the

ticket is created.

-----Original Message-----
From: Todd Chapman [mailto:todd@chaka.net]
Sent: Tuesday, November 22, 2005 11:57 AM
To: Andrew Xenides
Cc: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Custom onCreate scrip

if ($self->TrasactionObj->Type eq ‘Create’ and
$self->TicketObj->RequestorAddresses =~ /send/) {
return 1;
}

Hi,

I want to do a custom condition for a scrip, which will basically be
OnCreate and Requestor address matches “blah” then send the auto reply.

At the moment I have

if ($self->TrasactionObj->Type =~ ‘Create’){
if ($self->TicketObj->RequestorAddresses =~ /dontsend/){
return (undef);
}
if ($self->TicketObj->RequestorAddresses !~ /send/){
return (undef);
}
}else{
return (undef)
}
return(1);

but that seems to be sending the auto reply on every transaction, not

just

when the ticket is created.

Im guessing im using the wrongs TransactionObj-> Type


The rt-users Archives

Be sure to check out the RT Wiki at http://wiki.bestpractical.com

Download a free sample chapter of RT Essentials from O’Reilly Media at

http://rtbook.bestpractical.com

WE’RE COMING TO YOUR TOWN SOON - RT Training in Amsterdam, Boston and
San Francisco - Find out more at

http://bestpractical.com/services/training.html


The rt-users Archives

Be sure to check out the RT Wiki at http://wiki.bestpractical.com

Download a free sample chapter of RT Essentials from O’Reilly Media at
http://rtbook.bestpractical.com

WE’RE COMING TO YOUR TOWN SOON - RT Training in Amsterdam, Boston and
San Francisco - Find out more at
http://bestpractical.com/services/training.html

Drew Barnes
Applications Analyst
Raymond Walters College
University of Cincinnati

Hi,

Is there any way to search for deleted tickets. No specific criteria, just
the queue name and status = deleted.

Thanks

Hi Les,

This made sense, thank you.

Jennifer

At 11/22/2005 12:45 PM, you wrote:

Hi Ruslan,

Thank you for the steps below. And for the NOTE of caution about breaking
the upgrade scripts. Very helpful.

I tried this approach on a development server running RH4, and the upgrade
scripts ran without errors.

Unfortunately, apache is not finding the RT htdocs on that machine, so I
haven’t been able to test results yet.

I will try these steps on the server I’m building for our upgrade next
week. They wanted me to test RH4 first.

Thank you again,
Jennifer

At 11/22/2005 04:14 PM, you wrote: