What version of RT4 am I running?

Hello All!
I have been using RT4 for quite a few years now. We had an issue with the host it was running on, but lucky for us we had a full backup of the database and of the rt4 directory. I am in the process of getting it back online.
My question is, how can I find the exact version number of the file structure and of the database? Is there a database entry that tells me what version? Is there a file somewhere in the directory that also says what version it is? I just need to make sure they are the same. :smiley:

Thank you,
Ron Fancella

Look in the file lib/RT/Generated.pm. That should have the version when your RT was installed.

Jim,
Thank you so much for the prompt reply!
It is there. That’s half of the equation. :wink:
Do you have any idea where to find it in my MySQL database?

Thank you,
Ron Fancella

What other bit of info are you looking for in the DB?

Jim,
I am looking for the version of RT that was last run against the database. I want to be sure the install version matches the database.

Thank you,
Ron Fancella

It would be very strange for the DB to somehow be out of sync with the code. If anything, it would be more likely someone might run a code update and not run the DB part.

There is no single RT version value stored in the DB, but after you restore you can check the “RT upgrade history” on the page at Admin > Tools > System Configuration.

I think that would be sometime very useful to have this information inside the database. For example when you run rt inside a k8s and need to known (automatically) if the deployment need or not to run a upgrade…

Where RT store those history ? I didn’t find it in the database, but they are present on the webui.
Thanks

Jim,
Again, thank you so much!
Have a great week!

Thank you,
Ron Fancella

select content from attributes where name = 'UpgradeHistory';

This seems to be manipulated in /opt/rt5/lib/RT/System.pm, so you may need code to decode it.

Alternatively you can use a perl one-liner:

perl -I/opt/rt5/lib -MRT -e'print $RT::VERSION';

I can’t see any reason why there couldn’t be a matching record in the attributes table. It looks as though a simple scalar value is stored verbatim, eg DefaultDashboard (3 in my system), whereas everything else is serialized using Storable (probably).

You can write a script based on the boilerplate used in other scripts and use the GetAttribute and SetAttribute methods to create a new attribute that exposes the version number directly in the database.

Sorry that’s not a full solution but I hope it may spark an idea for you.

Simon.