Error upgrading db from 3.6.3 to 4.0.0

I’m moving RT to a new server and taking the opportunity to upgrade versions as well.

Currently, v3.6.3 on FC4 and MySql 4.1.16.

I backed up the db with

Mysqldump --opt --add-drop-table --single-transaction -default-character-set=binary -u root -pXXXXXXX rt3 >rt363.adhoc.bkup

Copied the SQL dump to the new server running CentOS 5.5 and MySql 5.0.77 and restored the RT3 db.

Last week, I successfully upgraded from 3.6.3 to 3.8.9 (patched the db to 3.7.87, applied the 3.8.0 schema changes, patched the database up to 3.8.9 as per UPGRADING.mysql). Worked great, no problems. Was just about to implement that when RT 4.0.0 was released…

So…I want to upgrade to that instead. There was no UPGRADING.mysql, just the README saying to run rt-setup-database.

When I try to upgrade from 3.6.3 all the way up to 4.0.0, I’m getting:
Processing 3.7.81
Now populating database schema.
[Mon May 2 20:53:58 2011] [crit]: DBD::mysql::st execute failed: Duplicate key name ‘CachedGroupMembers3’ at /opt/rt4/sbin/…/lib/RT/Handle.pm line 503. (/opt/rt4/sbin/…/lib/RT.pm:340)
DBD::mysql::st execute failed: Duplicate key name ‘CachedGroupMembers3’ at /opt/rt4/sbin/…/lib/RT/Handle.pm line 503.

Since the 3.8.9 upgrade worked fine (with the included schema change queries), I used rt3.8.9 to upgrade my 3.6.3 to 3.8.9 (again, going to 3.7.87, applying the schema change queries, then upgrading the db to 3.8.9). Which, again, worked fine.

Then, using RT 4.0.0, I tried to update the database from 3.8.9 to 4.0.0 and am getting the error:
Processing 3.9.3
Now populating database schema.
[Mon May 2 20:31:51 2011] [crit]: DBD::mysql::st execute failed: Can’t DROP ‘DelegatedBy’; check that column/key exists at /opt/rt4/sbin/…/lib/RT/Handle.pm line 503. (/opt/rt4/sbin/…/lib/RT.pm:340)
DBD::mysql::st execute failed: Can’t DROP ‘DelegatedBy’; check that column/key exists at /opt/rt4/sbin/…/lib/RT/Handle.pm line 503.

Do I need to upgrade incrementally from 3.6.3 to 3.8.9 to 3.9.x and then to 4.0.0? Is there info on this that I missed? Or, should the rt-setup-database handle the jump from 3.6.3 to 4.0.0 (including 3.8.0’s schema changes)?

(I’m not a SQL expert in the least).

Thanks for any help!
Steve

So…I want to upgrade to that instead. There was no UPGRADING.mysql, just the README saying
to run rt-setup-database.

UPGRADING.mysql is now in docs and is still referenced in README and
UPGRADING-3.6 which you should be reading (along with UPGRADING-3.8
and UPGRADING-4.0)

When I try to upgrade from 3.6.3 all the way up to 4.0.0, I’m getting:

Processing 3.7.81

Now populating database schema.

[Mon May 2 20:53:58 2011] [crit]: DBD::mysql::st execute failed: Duplicate key name
’CachedGroupMembers3’ at /opt/rt4/sbin/…/lib/RT/Handle.pm line 503.
(/opt/rt4/sbin/…/lib/RT.pm:340)

DBD::mysql::st execute failed: Duplicate key name ‘CachedGroupMembers3’ at
/opt/rt4/sbin/…/lib/RT/Handle.pm line 503.

Looks like you ran 3.7.81 twice

Now populating database schema.

[Mon May 2 20:31:51 2011] [crit]: DBD::mysql::st execute failed: Can’t DROP ‘DelegatedBy’;
check that column/key exists at /opt/rt4/sbin/…/lib/RT/Handle.pm line 503.
(/opt/rt4/sbin/…/lib/RT.pm:340)

DBD::mysql::st execute failed: Can’t DROP ‘DelegatedBy’; check that column/key exists at
/opt/rt4/sbin/…/lib/RT/Handle.pm line 503.

Looks like you ran something else twice too, since that column has
existed since at least 3.4

Do I need to upgrade incrementally from 3.6.3 to 3.8.9 to 3.9.x and then to 4.0.0? Is there
info on this that I missed? Or, should the rt-setup-database handle the jump from 3.6.3 to
4.0.0 (including 3.8.0’s schema changes)?

You can use rt-setup-database from 3.6.3 to 3.7.81 follow
UPGRADING.mysql and then continue onward from there to 4.0.0

Also, there is no reason to use a 3.8.9 tarball and a 4.0.0 tarball,
you can do it all from the fresh install in /opt/rt4

-kevin

Processing 3.7.81
DBD::mysql::st execute failed: Duplicate key name
’CachedGroupMembers3’ at
/opt/rt4/sbin/…/lib/RT/Handle.pm line 503.

Looks like you ran 3.7.81 twice

DBD::mysql::st execute failed: Can’t DROP ‘DelegatedBy’; check
that column/key exists at
/opt/rt4/sbin/…/lib/RT/Handle.pm line 503.

Looks like you ran something else twice too, since that column has
existed since at least 3.4

Yep, self-inflicted for sure…was trying to figure out how I ran twice when I realized that I had restored the db to the new box and called it rt3 AND when I did a fresh install of RT4.0.0 I had also initialized the database (to make sure everything was working before dealing with the data). So when I was running rt-setup-database, it was running against the rt4 database, which of course was already current, not the rt3 that I had restored.

You can use rt-setup-database from 3.6.3 to 3.7.81 follow
UPGRADING.mysql and then continue onward from there to 4.0.0

I dropped the blank rt4 db, renamed my rt3 db to rt4 and ran through the steps above and it worked perfectly.

Thanks, Kevin!!