Forgot to make upgrade-database

Hi,

Upgraded from 4.4.1 to 4.4.3. I forgot to “make upgrade-database” and started Apache. I logged in and clicked on a few things, no writes. There might have been some writes via the REST API in the background, can’t know for sure.

I then remembered, stopped Apache and did “make upgrade-database” and stated Apache again.
We have tested for a few hours and all seems well.
This is a critical environment, we cannot rollback now or do the upgrade again. Aah!

What I would like to know please: what is the impact of upgrading and not applying the database changes and starting Apache again, possibly doing some writes etc. and then stopping, upgrading the DB and starting Apache again?

Must I do some specific checks?

Thank you.

I can’t say what the impact of upgrading RT and not upgrading the DB would have but you could try and run the rt-validator tool to see if anything in the database comes up as invalid.

https://docs.bestpractical.com/rt/4.4.4/rt-validator.html

1 Like

In this case you got off relatively easy. There were a few indices added and some minor “tidying”.
if you look in BASE/etc/rt/upgrade/ you’ll see a directory per version of RT. Anything higher than you’re old version will be checked. Files such as content, indexes and schema.DATABASETYPE will be run to tweak
the existing database for the new version of RT.
Best case: there’s nothing to be done - pure code.
Worst case: RT doesn’t start since it can’t find a new field in a table.

1 Like

I ran “rt-validator --check --verbose” and got plenty of:

“Record #109 in ObjectCustomFieldValues references a nonexistent record in Tickets ObjectId => ‘26’ => id”
“Record #192 in Groups references a nonexistent record in Tickets Instance => ‘30’ => id”
“Record #242 in Links. Value of Base column most probably is an incorrect link”

Is it safe to run “rt-validator --check --verbose --resolve”?

I did look in BASE/etc/rt/upgrade, thanks for confirming that.
As you said, worst case, which didn’t happen.

I just want to say a very big thank you to Jeff and all the other good people involved with RT. Your help and support are invaluable!
Cheers.

I am playing with migration from MariaDB to Postgresql for some time and the crucial prerequisite is to run rt-validator, then rt-serializer and finally rt-importer. I had tons of nonexistent records messages, repaired them automatically and I can not see any errors in new database. I’ve also discussed this issue with BP support and they’ve told me not to be afraid.
In fact, rt-validator is there to fix such problems :slight_smile: They usually come from past times when rt-shredder was not so tuned as nowadays and maybe some other issues with DB might have occured. We are using RT from Mon Mar 15 1999 (version 0.9.6?) and there could occured anything in the past times in the DB.

Cool. Thanks for the positive feedback. I have scheduled maintenance with my team to run the validator and will post feedback.