<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Apr 10, 2013 at 1:38 AM, Ken Johnson <span dir="ltr"><<a href="mailto:kjohnson@eclypse.org" target="_blank">kjohnson@eclypse.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
>On Fri, Apr 05, 2013 at 05:43:41PM -0500, Ken Johnson wrote:<br>
>> I'm trying to upgrade from RT 3.4.5 to 4.0.7 on Debian 6.0.7.<br>
>><br>
>> I backed up the existing database and loaded it a new database<br>
>> according the the instructions in UPGRADING.mysql.  I reached the<br>
>> point where I believed it was time to perform the first stage of the<br>
>> database upgrades, and used a command like this:<br>
>><br>
>> rt-setup-database-4 --action upgrade --dba user --dba-password<br>
>> password Enter RT version you're upgrading from: 3.4.5<br>
><br>
>On Fri, Apr 05, 2013 Kevin Falcone wrote:<br>
><br>
>It looks like at some point in the past - someone upgraded you to<br>
>3.4.5 without running the database upgrades.  Version 3.3.0 of RT<br>
>added the Pattern column to the CustomFields table.<br>
><br>
><a href="https://github.com/bestpractical/rt/blob/stable/etc/upgrade/3.3.0/schema.my" target="_blank">https://github.com/bestpractical/rt/blob/stable/etc/upgrade/3.3.0/schema.my</a><br>
sql<br>
><br>
>I'd be really concerned and be looking to see what else between<br>
>your older version and 3.4.5 was never upgraded.<br>
><br>
>-kevin<br>
<br>
Thank you for the pointer to github.<br>
<br>
I looked.  Based on what tables and columns are present, I conclude that<br>
the database updates for 3.3.0 and 3.3.11 were run, but for reasons<br>
unknown, the very last part of the 3.3.0 database update, beginning with<br>
'ALTER TABLE CustomFields ...' and including 'UPDATE CustomFields...'<br>
did not occur.  On the other hand, dropping the Current column from the<br>
TicketCustomFieldValues table in the 3.3.11 update did occur.<br></blockquote><div><br></div><div style>The only idea is that intermediate step failed and this was not noticed by administrator, so he just continued further.</div>
<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
My best idea is to apply the missed portion of the updates and proceed,<br>
along the lines of the shell script below.  Not ideal, but I don't know<br>
a better approach that does not involve time travel.  That approach<br>
generates<br>
one warning during the generation of the queries.sql file:<br>
<br>
Use of uninitialized value in join or string at<br>
/usr/share/request-tracker3.8/etc/upgrade/<a href="http://upgrade-mysql-schema.pl" target="_blank">upgrade-mysql-schema.pl</a> line 261.<br>
.Groups.Instance has type VARCHAR however mapping is missing.<br></blockquote><div> </div><div style>In upgrade scripts find ALTER TABLE that changes Instance from VARCHAR to INTEGER.</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

All of the other operations have no complaints.<br>
<br>
Ken<br>
<br>
================== script to do the database updates =====================<br>
<br>
#!/bin/bash -vx<br>
#<br>
# Drop the previous RT4 database.<br>
#<br>
mysql --user=user --password=password </home/shared/sysadmin/dropRT4.sql<br>
#<br>
# Create an empty RT4 database.<br>
# Specify the character set default of the RT4 database.  See<br>
UPGRADING.mysql item 1b)<br>
#<br>
mysql --user=user --password=password </home/shared/sysadmin/createRT4.sql<br>
#<br>
# Dump the RT3 database to an .sql file.  See UPGRADING.mysql item 1a)<br>
#<br>
mysqldump -F --opt --user=user --password=password<br>
--default-character-set=binary rt3 >/tmp/daily/rt3.sql<br>
#<br>
# Load rt3.sql into the RT4 database.  See UPGRADING.mysql item 1c)<br>
#<br>
mysql --user=user --password=password --default-character-set=binary rt4<br>
</tmp/daily/rt3.sql<br>
#<br>
# Grant access for rt_user to the RT4 database<br>
#<br>
mysql --user=user --password=password rt4<br>
</home/shared/sysadmin/grantRT4.sql<br>
#<br>
# Apply the 3.3.0 database update subset<br>
#<br>
mysql --user=user --password=password rt4<br>
</home/shared/sysadmin/rt3.3.0dbpartial.sql<br>
#<br>
# Apply the 3.3.11 database update subset (nothing to do -- previously<br>
done.)<br>
#<br>
# mysql --user=user --password=password rt4<br>
</home/shared/sysadmin/rt3.3.11dbpartial.sql<br>
#<br>
# Apply the 3.3.11-3.7.87 updates with rt-setup-database-4 --action upgrade<br>
--dba user --dba-password password<br>
#<br>
rt-setup-database-4 --action upgrade --dba user --dba-password password<br>
</home/shared/sysadmin/first.txt<br>
#<br>
# Apply the RT 3.8 schema upgrades.  See UPGRADING.mysql item 5)<br>
#   First step, generate queries.sql file<br>
#   Second step, apply queries.sql file.  See UPGRADING.mysql item 7)<br>
#   See /usr/share/request-tracker3.8/etc/<a href="http://upgrade-mysql-schema.pl" target="_blank">upgrade-mysql-schema.pl</a><br>
perl /usr/share/request-tracker3.8/etc/upgrade/<a href="http://upgrade-mysql-schema.pl" target="_blank">upgrade-mysql-schema.pl</a> rt4<br>
user password >/home/shared/sysadmin/queries.sql<br>
mysql --user=user --password=password rt4 </home/shared/sysadmin/queries.sql<br>
#<br>
# Apply the RT 3.7.87-4.0.6 database updates.  See UPGRADING.mysql item 8)<br>
#<br>
rt-setup-database-4 --action upgrade --dba user --dba-password password<br>
</home/shared/sysadmin/second.txt<br>
<br>
<br>
<br>
<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Best regards, Ruslan.
</div></div>