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!

So I am one of those guys who has to keep jumping between tasks, and this upgrade has taken some time.

There is a part of the install process I am confused by. I have set up my new host, installed RT and am at step 6 of the 6.0.2 README: README - RT 6.0.2 Documentation - Best Practical

I am still setting up the new host so I look to 6a, but I am not clear on whether to use rt-server or manually with apache2 and RT_SiteConfig.pm

My initial want is to use

@rt6:~$ sudo /opt/rt6/sbin/rt-server --port 8080

and the web installer as I figured it should know better than me what to put into RT_SiteConfig.pm but it won’t connect to my database.

I get the install page OK : http://support.pdf-xchange.com:8080/Install/index.html and it suggests I can click the “Let’s go!” button to initialize a new database:

Getting started

You’re seeing this screen because you started up an RT server without a working database. Most likely, this is the first time you’re running RT. If you click “Let’s go!” below, RT will guide you through setting up your RT server and database.

but when I do I get this:

And this at the shell:

@rt6:~$ sudo /opt/rt6/sbin/rt-server --port 8080[13660] [Fri Nov 21 00:02:34 2025] [warning]: DBD::SQLite::db prepare failed: no such table: Users at /usr/local/share/perl/5.38.2/DBIx/SearchBuilder/Handle.pm line 585. (/usr/local/share/perl/5.38.2/DBIx/SearchBuilder/Handle.pm:585)[13660] [Fri Nov 21 00:02:34 2025] [warning]: RT::Handle=HASH(0x5e7f9bd1a6e0) couldn’t prepare the query 'SELECT  * FROM Users WHEREName = ?'no such table: Users (/usr/local/share/perl/5.38.2/DBIx/SearchBuilder/Handle.pm:592)
RT couldn’t connect to the database where tickets are stored.If this is a new installation of RT, you should visit the URL belowto configure RT and initialize your database.
If this is an existing RT installation, this may indicate a databaseconnectivity problem.
The error RT got back when trying to connect to your database was:
Couldn’t find RT_System user in the DB ‘dbi:SQLite:dbname=/opt/rt6/var/rt6;host=localhost’
[13660] [Fri Nov 21 00:02:34 2025] [warning]: DBD::SQLite::db prepare failed: no such table: Users at /usr/local/share/perl/5.38.2/DBIx/SearchBuilder/Handle.pm line 585. (/usr/local/share/perl/5.38.2/DBIx/SearchBuilder/Handle.pm:585)[13660] [Fri Nov 21 00:02:34 2025] [warning]: RT::Handle=HASH(0x5e7f9bd1a6e0) couldn’t prepare the query 'SELECT  * FROM Users WHEREName = ?'no such table: Users (/usr/local/share/perl/5.38.2/DBIx/SearchBuilder/Handle.pm:592)HTTP::Server::PSGI: Accepting connections at http://0:8080/[13660] [Fri Nov 21 00:02:59 2025] [error]: Can’t call method “MaybeRebuildLifecycleCache” on unblessed reference at /opt/rt6/sbin/../lib/RT/Interface/Web.pm line 1234,  line 1662.
Stack:[/opt/rt6/sbin/../lib/RT/Interface/Web.pm:1234][/opt/rt6/share/html/Install/index.html:129][/opt/rt6/share/html/Install/autohandler:60] (/opt/rt6/sbin/../lib/RT/Interface/Web/Handler.pm:216)

I can connect locally:

@rt6:~$ sudo mysql -u root -pEnter password:Welcome to the MySQL monitor.  Commands end with ; or \g.Your MySQL connection id is 12Server version: 8.0.44-0ubuntu0.24.04.1 (Ubuntu)
Copyright (c) 2000, 2025, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.
Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.
mysql> show databases;±-------------------+| Database           |±-------------------+| information_schema || mysql              || performance_schema || sys                |±-------------------+4 rows in set (0.02 sec)
mysql> quit

What does rt-server use to connect to the database if not root?

It looks like it is expecting a preconfigured database but

make initialize-database

is part of the manual config that needs proper settings in RT_SiteConfig.pm

What needs to go in RT_SiteConfig.pm to get rt-server working for the install?

Should I forget the web installer and try and get tis going with make initialize database and a complete RT_SiteConfig.pm? When I tried that I couldn’t get past the login page without an internal server error.

/opt/rt6/var/log/ is empty. Where should I be looking to find out why it can’t connect and create the database?

What are your ./configure parameters? Are they set properly in etc/RT_Config.pm?

The first warning is telling you it tries to connect to a SQLite DB, not to a MySQL DB. Maybe it’s the default DB for rt-server (I can’t remember, it’s suitable only for testing functionality).

SQLite DB doesn’t need other parameters like with_db_host/port/dba/… when executing ./configure

So, maybe for testing with rt-server you need to set the configuration manually for SQLite and then execute make initialize-database before launching the server.

Thanks @sollericos ,

as I understand it, the whole point of rt-server is to facilitate the web installer and avoid needing to manually edit RT_SiteConfig.pm.

Am I missing some fundamental understanding? Now the notes do say it is not secure to not change the default password, but I believe that is the rt_user “root”, not the MySQL DB user “root” that can created the database rt6 will use.

When I try setting up RT_SiteConfig.pm with what I think is correct then do make initialize-database I again get “internal server error” because I don’t think my Apache2 is right.

I can go there, RT_SiteConfig.pm and make initialize-database and and see about tweaking things, but I am I guess stubborn, the docs say rt-server with an unconfigured database is possible and I am ken to see that web installer.

Surely it is just a matter to getting rt-server to use the right MySQL credentials so it can create this DB and show me the web installer?