Please help, upgrade issue from RT 5.0.4 to 6.0.1

Hello, everyone,

Good day to you all.Running to the following error message while do a make database-upgrade from 5.0.4 to 6.0.1 .

Processing 5.9.4Now populating database schema.[432166] [Sun Oct 26 17:06:03 2025] [critical]: DBD::mysql::st execute failed: Table ‘SavedSearches’ already exists at /opt/RT/src/rt-6.0.1/sbin/../lib/RT/Handle.pm line 556. (/opt/RT/src/rt-6.0.1/sbin/../lib/RT.pm:409)DBD::mysql::st execute failed: Table ‘SavedSearches’ already exists at /opt/RT/src/rt-6.0.1/sbin/../lib/RT/Handle.pm line 556.make: *** [Makefile:396: upgrade-database] Error 11

This is what I did:

A. make initialize-database

B. $ gunzip -c /tmp/backup-10-25/rt-db-12-35-01_10-25-2025.sql.gz | mysql -uroot -p rt6 ( populate RT 5.0.4 DB to 6.0.1 This runs OK , no issue seen.C. make upgrade-database

root@rcic-rt-1-new:/opt/RT/src/rt-6.0.1$ make upgrade-database
/usr/bin/perl -I/opt/RT/6.0.1/local/lib -I/opt/RT/6.0.1/lib sbin/rt-setup-database --action upgrade --prompt-for-dba-password
In order to create or update your RT database, this script needs to connect to your mysql instance on localhost (port ‘’) as root
Please specify that user’s database password below. If the user has no database
password, just press return.

Password:
Working with:
Type: mysql
Host: localhost
Port:
Name: rt6
User: rt_user
DBA: root
Enter RT version you’re upgrading from: 5.0.4

Going to apply following upgrades:

  • 5.0.5
  • 5.0.6
  • 5.0.8
  • 5.9.0
  • 5.9.1
  • 5.9.2
  • 5.9.3
  • 5.9.4
  • 5.9.5
  • 5.9.6
  • 5.9.7
  • 6.0.1

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

Going to apply following upgrades:

  • 5.0.5
  • 5.0.6
  • 5.0.8
  • 5.9.0
  • 5.9.1
  • 5.9.2
  • 5.9.3
  • 5.9.4
  • 5.9.5
  • 5.9.6
  • 5.9.7
  • 6.0.1

IT’S VERY IMPORTANT TO BACK UP BEFORE THIS STEP

Proceed [y/N]:y
Processing 5.0.5
Now populating database schema.
Now inserting database indexes.
Now inserting data.
Processing 5.0.6
Now inserting database indexes.
Processing 5.0.8
Now populating database schema.
Now inserting database indexes.
Processing 5.9.0
Now inserting data.
Processing 5.9.1
Now inserting data.
Processing 5.9.2
Now populating database schema.
Now inserting data.
Processing 5.9.3
Now inserting data.
Processing 5.9.4
Now populating database schema.
[428192] [Sun Oct 26 15:55:25 2025] [critical]: DBD::mysql::st execute failed: Table ‘SavedSearches’ already exists at /opt/RT/src/rt-6.0.1/sbin/../lib/RT/Handle.pm line 556. (/opt/RT/src/rt-6.0.1/sbin/../lib/RT.pm:409)
DBD::mysql::st execute failed: Table ‘SavedSearches’ already exists at /opt/RT/src/rt-6.0.1/sbin/../lib/RT/Handle.pm line 556.

I see the SavedSearches table was created by the 6.0.1 ( initialize-database command ) and it looks like /opt/RT/src/rt-6.0.1/etc/upgrade/5.9.4/schema.mysql file wants to create the tables, and hence causes the error.

Any suggestions on how to overcome this error? Would it be OK or is there a way to skip 5.9.4 update? In 5.9.4 I see the tables are being created which is why this fails - so, is there a way to 5.9.4 upgrade can be skipped?

thanks a bunch!

If you’re upgrading an existing database you might not have needed the make initialize-database command at the start. That makes a blank database with the new schema, whereas what I think you were trying to do was import a database with the old 5.x schema and then update it.

I am in a similar situation, trying to do an upgrade from 4.4.2 to current (6.0.2).

Because my 4.4.2 is on an Ubuntu LTS that is rather old, Ubuntu 16.04.7 LTS, I took a different approach and am trying to install a clean 6.02 on a new host running Ubuntu 24.04.3 LTS.

My plan was to get that going, then clone the live instance, perform that database upgrades on the clone, then import that to the new server from a mysql.dump.

I am having issues with the 6.02 install and came here looking for help. Seeing this thread, I need to ask if my approach is valid.

If it is I will start a new topic with the challenge I am seeing setting up a clean new 6.02.

Please and thanks

You can create an “empty” db with this command:

    /opt/rt6/sbin/rt-setup-database --action create,acl

This is what I did .

A. Install RT:
export RT_FIX_DEPS_CMD=/usr/local/bin/cpanm
export RTVERSION=6.0.1
cd /opt/RT/src/rt-${RTVERSION} && ./configure --prefix=/opt/RT/${RTVERSION} --enable-graphviz --enable-externalauth --with-web-user=apache --with-web-group=apache --with-db-type=MariaDB

make fixdeps & make install

B. Create empty DB:
CREATE DATABASE rt6 CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
GRANT ALL PRIVILEGES ON rt6.* TO ‘rt_user’@‘localhost’ IDENTIFIED BY ‘’;
GRANT ALL PRIVILEGES ON rt6.* TO ‘rt_user’@‘%’ IDENTIFIED BY ‘’;
FLUSH PRIVILEGES;

C. Upgrade DB:

cd /opt/RT/src/rt-${RTVERSION}
make upgrade-database
I am running 5.0.4 now and went upto 6.0.1 .

I tried going to 6.0.2 , but upgrade-database has no option to go to 6.0.2 , just 6.0.1 . So, I stayed with 6.0.1 .

I don’t think it is clear from the general documentation of RT on how to “upgrade” an existing installation with new codebase and also with a DB upgrade.

So all this on the original host? I need to also upgrade the host, so your approach seems similar but for then migrating the 6.01 DB to a new host.

Sounds solid, I see a few things there that will help. Appreciated.

This is one a new host ( VM ) .

I have a script that backs up every important file(s) from a running VM with RT 5.0.4 , and then I take it to a new ( test ) VM .

I wouldn’t do the manual DB steps, the RT schema files handle that for you:

"GRANT SELECT,INSERT,CREATE,INDEX,UPDATE,DELETE
               ON `$db_name`.*
               TO '$db_user'\@'$db_rthost'
               IDENTIFIED BY '$db_pass';",

Also when migrating to a new database you can create an empty RT database:

/opt/rt6/sbin/rt-setup-database --action create,acl

Then inject your data:

gunzip -c rt-20141014.sql.gz | mysql -uroot -p rt6 

Then you can run the upgrade steps. The docs can be found here:

Thanks! That is great to know. I can certainly try that out.
–imam

Indeed very helpful stuff.

A related but different question.

I am upgrading from 4.4.2 to 6.0.2 and reading through the UPGRADING FROM documents. On the UPGRADING-5.0 - RT 6.0.2 Documentation - Best Practical page is says this:

Upgrading to RT 5 over an existing RT 4 installation (/opt/rt4) is not recommended and will almost certainly cause issues. Instead, do a fresh install into /opt/rt6 (or your custom location) for the code portion of the upgrade. Then import your existing database and run the database upgrade steps using make upgrade-database.

Do I interpret that correctly if I understand this means I can:

  1. Create a new rt6 on a new host
  2. Mysqldump the db from 4.4.2
  3. gunzip -c rt-4.4.2.sql.gz | mysql -uroot -p rt6
  4. Follow 6b here README - RT 6.0.2 Documentation - Best Practical and issue ‘make upgrade-database’?

When creating rt6 do I ‘make initialize-database’ or use

6b says:

make upgrade
  • This will also prompt you to upgrade your database by running:
make upgrade-database

Does that mean rt6 can import my rt4.4.2 mysqldump directly and I can do make upgrade-database on the new rt6 host? No need to clone 4.4.2 and do a make upgrade on it?

To do this step:

gunzip -c rt-4.4.2.sql.gz | mysql -uroot -p rt6

You will need the database already created, so running:


/opt/rt6/sbin/rt-setup-database --action create,acl

First is what you want to do.

No need to clone 4.4.2 and do a make upgrade on it?

Correct, the 4.4.2 source code won’t have the subsequent upgrade steps anyway

  1. Create empty db
  2. Restore RT 5 db to new RT 6 database
  3. Run upgrade script
  4. Run validator & then try and hit the web UI and confirm everything looks good
1 Like

Thank you very much for the quick and clear answer!