Problem upgrading database from 3.8.6 to 4.0.1 on Ubuntu 8.0.4(mysql)

Hi,

We have upgraded from RT 3.8.6 (Ubuntu 8.0.4, Mysql,Posfix,Apache) to 4.0.1 but ran into a problem whilst upgrading the database. We created a new RT4 database with ‘make initialize-database’ and imported an rt3 dump with ‘mysql -p rt4 < rt3.dump’.

We then ran ‘/opt/rt4/sbin/rt-setup-database --prompt-for-dba-password --action upgrade’ to upgrade the database but received the error below at the upgrading 3.9.1. stage.

Has anyone experienced the same problem or did I maybe miss something out?

Regards,

Wikus

Enter RT version you’re upgrading from: 3.8.6

Going to apply following upgrades:

  • 3.8.8
  • 3.8.9
  • 3.9.1
  • 3.9.2
  • 3.9.3
  • 3.9.5
  • 3.9.6
  • 3.9.7
  • 3.9.8
  • 4.0.0rc2
  • 4.0.0rc4
  • 4.0.0rc7
  • 4.0.1

Enter RT version if you want to stop upgrade at some point,
or leave it blank if you want apply above upgrades:

IT’S VERY IMPORTANT TO BACK UP BEFORE THIS STEP

Proceed [y/N]:y
Processing 3.8.8
Now inserting data.
Processing 3.8.9
Now inserting data.
Processing 3.9.1
Now inserting data.
[Fri Jul 29 08:03:16 2011] [warning]: Couldn’t change Type of Template #1: That is already the current value (./etc/upgrade/3.9.1/content:28)
[Fri Jul 29 08:03:16 2011] [warning]: Couldn’t change Type of Template #2: That is already the current value (./etc/upgrade/3.9.1/content:28)
[Fri Jul 29 08:03:16 2011] [warning]: Couldn’t change Type of Template #3: That is already the current value (./etc/upgrade/3.9.1/content:28)
[Fri Jul 29 08:03:16 2011] [warning]: Couldn’t change Type of Template #4: That is already the current value (./etc/upgrade/3.9.1/content:28)
[Fri Jul 29 08:03:16 2011] [warning]: Couldn’t change Type of Template #5: That is already the current value (./etc/upgrade/3.9.1/content:28)
[Fri Jul 29 08:03:16 2011] [warning]: Couldn’t change Type of Template #6: That is already the current value (./etc/upgrade/3.9.1/content:28)
[Fri Jul 29 08:03:16 2011] [warning]: Couldn’t change Type of Template #7: That is already the current value (./etc/upgrade/3.9.1/content:28)
[Fri Jul 29 08:03:16 2011] [warning]: Couldn’t change Type of Template #8: That is already the current value (./etc/upgrade/3.9.1/content:28)
[Fri Jul 29 08:03:16 2011] [warning]: Couldn’t change Type of Template #9: That is already the current value (./etc/upgrade/3.9.1/content:28)
[Fri Jul 29 08:03:16 2011] [warning]: Couldn’t change Type of Template #10: That is already the current value (./etc/upgrade/3.9.1/content:28)
[Fri Jul 29 08:03:16 2011] [warning]: Couldn’t change Type of Template #11: That is already the current value (./etc/upgrade/3.9.1/content:28)
[Fri Jul 29 08:03:16 2011] [warning]: Couldn’t change Type of Template #12: That is already the current value (./etc/upgrade/3.9.1/content:28)
[Fri Jul 29 08:03:16 2011] [warning]: Couldn’t change Type of Template #13: That is already the current value (./etc/upgrade/3.9.1/content:28)
[Fri Jul 29 08:03:16 2011] [warning]: Couldn’t change Type of Template #14: That is already the current value (./etc/upgrade/3.9.1/content:28)
[Fri Jul 29 08:03:16 2011] [warning]: Couldn’t change Type of Template #15: That is already the current value (./etc/upgrade/3.9.1/content:28)
[Fri Jul 29 08:03:16 2011] [warning]: Couldn’t change Type of Template #16: That is already the current value (./etc/upgrade/3.9.1/content:28)
[Fri Jul 29 08:03:16 2011] [warning]: Couldn’t change Type of Template #17: That is already the current value (./etc/upgrade/3.9.1/content:28)
[Fri Jul 29 08:03:16 2011] [warning]: Couldn’t change Type of Template #18: That is already the current value (./etc/upgrade/3.9.1/content:28)
[Fri Jul 29 08:03:16 2011] [warning]: Couldn’t change Type of Template #19: That is already the current value (./etc/upgrade/3.9.1/content:28)
[Fri Jul 29 08:03:16 2011] [warning]: Couldn’t change Type of Template #20: That is already the current value (./etc/upgrade/3.9.1/content:28)
[Fri Jul 29 08:03:16 2011] [warning]: Couldn’t change Type of Template #21: That is already the current value (./etc/upgrade/3.9.1/content:28)
[Fri Jul 29 08:03:16 2011] [warning]: Couldn’t change Type of Template #22: That is already the current value (./etc/upgrade/3.9.1/content:28)
Processing 3.9.2
Now inserting data.
[Fri Jul 29 08:03:19 2011] [warning]: DBD::mysql::st execute failed: Unknown column ‘main.DelegatedBy’ in ‘where clause’ at /usr/local/share/perl/5.8.8/DBIx/SearchBuilder/Handle.pm line 509, <> line 1. (/usr/local/share/perl/5.8.8/DBIx/SearchBuilder/Handle.pm:509)
[Fri Jul 29 08:03:19 2011] [warning]: RT::Handle=HASH(0xa706830) couldn’t execute the query 'SELECT main.* FROM ACL main WHERE (main.DelegatedBy > ‘0’) AND (main.DelegatedFrom > ‘0’) ’ at /usr/local/share/perl/5.8.8/DBIx/SearchBuilder/Handle.pm line 522
DBIx::SearchBuilder::Handle::SimpleQuery(‘RT::Handle=HASH(0xa706830)’, ‘SELECT main.* FROM ACL main WHERE (main.DelegatedBy > ‘0’)…’) called at /usr/local/share/perl/5.8.8/DBIx/SearchBuilder.pm line 235
DBIx::SearchBuilder::_DoSearch(‘RT::ACL=HASH(0xae93978)’) called at /opt/rt4/sbin/…/lib/RT/SearchBuilder.pm line 320
RT::SearchBuilder::_DoSearch(‘RT::ACL=HASH(0xae93978)’) called at /opt/rt4/sbin/…/lib/RT/ACL.pm line 260
RT::ACL::_DoSearch(‘RT::ACL=HASH(0xae93978)’) called at /usr/local/share/perl/5.8.8/DBIx/SearchBuilder.pm line 503
DBIx::SearchBuilder::Next(‘RT::ACL=HASH(0xae93978)’) called at /opt/rt4/sbin/…/lib/RT/ACL.pm line 225
RT::ACL::Next(‘RT::ACL=HASH(0xae93978)’) called at ./etc/upgrade/3.9.2/content line 19
RT::Handle::ANON() called at /opt/rt4/sbin/…/lib/RT/Handle.pm line 767
eval {…} called at /opt/rt4/sbin/…/lib/RT/Handle.pm line 767
RT::Handle::InsertData(‘RT::Handle=HASH(0xa706830)’, ‘./etc/upgrade/3.9.2/content’, ‘undef’) called at /opt/rt4/sbin/rt-setup-database line 292
main::action_insert(‘prompt-for-dba-password’, 1, ‘datafile’, ‘undef’, ‘action’, ‘upgrade’, ‘datadir’, ‘./etc/upgrade/3.9.2’, ‘backcompat’, …) called at /opt/rt4/sbin/rt-setup-database line 398
main::action_upgrade(‘prompt-for-dba-password’, 1, ‘action’, ‘upgrade’, ‘dba’, ‘root’) called at /opt/rt4/sbin/rt-setup-database line 197 (/usr/share/perl/5.8/Carp.pm:105)
[Fri Jul 29 08:03:19 2011] [crit]: _DoSearch is not so successful as it still needs redo search, won’t call _BuildHash (/opt/rt4/sbin/…/lib/RT/ACL.pm:263)
Processing 3.9.3
Now populating database schema.
[Fri Jul 29 08:03:19 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 517. (/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 517.Jul 29 08:04:10 2011] [warning]: Couldn’t change Type of Template #15: That is already the current value (./etc/upgrade/3.9.1/content:28)
[Fri Jul 29 08:04:10 2011] [warning]: Couldn’t change Type of Template #16: That is already the current value (./etc/upgrade/3.9.1/content:28)
[Fri Jul 29 08:04:10 2011] [warning]: Couldn’t change Type of Template #17: That is already the current value (./etc/upgrade/3.9.1/content:28)
[Fri Jul 29 08:04:10 2011] [warning]: Couldn’t change Type of Template #18: That is already the current value (./etc/upgrade/3.9.1/content:28)
[Fri Jul 29 08:04:10 2011] [warning]: Couldn’t change Type of Template #19: That is already the current value (./etc/upgrade/3.9.1/content:28)
[Fri Jul 29 08:04:10 2011] [warning]: Couldn’t change Type of Template #20: That is already the current value (./etc/upgrade/3.9.1/content:28)
[Fri Jul 29 08:04:10 2011] [warning]: Couldn’t change Type of Template #21: That is already the current value (./etc/upgrade/3.9.1/content:28)
[Fri Jul 29 08:04:10 2011] [warning]: Couldn’t change Type of Template #22: That is already the current value (./etc/upgrade/3.9.1/content:28)
Processing 3.9.2
Now inserting data.
[Fri Jul 29 08:04:13 2011] [warning]: DBD::mysql::st execute failed: Unknown column ‘main.DelegatedBy’ in ‘where clause’ at /usr/local/share/perl/5.8.8/DBIx/SearchBuilder/Handle.pm line 509, <> line 1. (/usr/local/share/perl/5.8.8/DBIx/SearchBuilder/Handle.pm:509)
[Fri Jul 29 08:04:13 2011] [warning]: RT::Handle=HASH(0xa706830) couldn’t execute the query 'SELECT main.* FROM ACL main WHERE (main.DelegatedBy > ‘0’) AND (main.DelegatedFrom > ‘0’) ’ at /usr/local/share/perl/5.8.8/DBIx/SearchBuilder/Handle.pm line 522
DBIx::SearchBuilder::Handle::SimpleQuery(‘RT::Handle=HASH(0xa706830)’, ‘SELECT main.* FROM ACL main WHERE (main.DelegatedBy > ‘0’)…’) called at /usr/local/share/perl/5.8.8/DBIx/SearchBuilder.pm line 235
DBIx::SearchBuilder::_DoSearch(‘RT::ACL=HASH(0xae93978)’) called at /opt/rt4/sbin/…/lib/RT/SearchBuilder.pm line 320
RT::SearchBuilder::_DoSearch(‘RT::ACL=HASH(0xae93978)’) called at /opt/rt4/sbin/…/lib/RT/ACL.pm line 260
RT::ACL::_DoSearch(‘RT::ACL=HASH(0xae93978)’) called at /usr/local/share/perl/5.8.8/DBIx/SearchBuilder.pm line 503
DBIx::SearchBuilder::Next(‘RT::ACL=HASH(0xae93978)’) called at /opt/rt4/sbin/…/lib/RT/ACL.pm line 225
RT::ACL::Next(‘RT::ACL=HASH(0xae93978)’) called at ./etc/upgrade/3.9.2/content line 19
RT::Handle::ANON() called at /opt/rt4/sbin/…/lib/RT/Handle.pm line 767
eval {…} called at /opt/rt4/sbin/…/lib/RT/Handle.pm line 767
RT::Handle::InsertData(‘RT::Handle=HASH(0xa706830)’, ‘./etc/upgrade/3.9.2/content’, ‘undef’) called at /opt/rt4/sbin/rt-setup-database line 292
main::action_insert(‘prompt-for-dba-password’, 1, ‘datafile’, ‘undef’, ‘action’, ‘upgrade’, ‘datadir’, ‘./etc/upgrade/3.9.2’, ‘backcompat’, …) called at /opt/rt4/sbin/rt-setup-database line 398
main::action_upgrade(‘prompt-for-dba-password’, 1, ‘action’, ‘upgrade’, ‘dba’, ‘root’) called at /opt/rt4/sbin/rt-setup-database line 197 (/usr/share/perl/5.8/Carp.pm:105)
[Fri Jul 29 08:04:13 2011] [crit]: _DoSearch is not so successful as it still needs redo search, won’t call _BuildHash (/opt/rt4/sbin/…/lib/RT/ACL.pm:263)
Processing 3.9.3
Now populating database schema.
[Fri Jul 29 08:04:13 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 517. (/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 517.

We have upgraded from RT 3.8.6 (Ubuntu 8.0.4, Mysql,Posfix,Apache) to
4.0.1 but ran into a problem whilst upgrading the database. We created a
new RT4 database with ‘make initialize-database’ and imported an rt3
dump with ‘mysql -p rt4 < rt3.dump’.

Importing the RT 3 data into a fresh RT 4 database won’t work. Delete
the rt4 database and simply import your rt3 data into a new database
named rt4. To put it another way, you’re just making an exact copy of
your old rt3 database, but named rt4. Don’t run make
initialize-database. Then run the upgrade steps, which will upgrade
your database.

You should start by reading our blog post
http://blog.bestpractical.com/2011/07/upgrading-to-rt-4.html and the
README included with RT.

Thomas

Please keep all replies on the list.On 07/29/2011 10:44 AM, Wikus Smit wrote:

I dropped the rt4 database and tried to import the rt3 database dump
with 'mysql -p rt4 < rt3.sql ’ as suggested but received an ‘ERROR
1049 (42000): Unknown database ‘rt4’’ error.

How can I import the rt3.sql dump file into mysql now that the rt4
database has been dropped?

This is basic MySQL administration. Just create an empty database
before hand with:

create database rt4;

Thomas

Thanks Thomas that worked! - we managed to upgrade to 4.0.1

Regards,

WikusFrom: rt-users-bounces@lists.bestpractical.com [mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Thomas Sibley
Sent: 29 July 2011 15:48
To: RT Users
Subject: Re: [rt-users] Problem upgrading database from 3.8.6 to 4.0.1 on Ubuntu 8.0.4(mysql)

Please keep all replies on the list.

I dropped the rt4 database and tried to import the rt3 database dump
with 'mysql -p rt4 < rt3.sql ’ as suggested but received an ‘ERROR
1049 (42000): Unknown database ‘rt4’’ error.

How can I import the rt3.sql dump file into mysql now that the rt4
database has been dropped?

This is basic MySQL administration. Just create an empty database
before hand with:

create database rt4;

In addition to this command people should setup permissions for
rt_user on this new database. Wikus got lucky as make initialize-database setups permissions and 'drop database rt4;'
doesn’t clear them.

rt-setup-database tool can be used to create database and grant required rights:

sbin/rt-setup-database --help
sbin/rt-setup-database --action ‘create,acl’ --datadir etc/ … other
options …

This works for mysql.

Best regards, Ruslan.