Kentico upgrade from 8.2 to 9. Getting Invalid column name 'DocumentInheritsStylesheet'.

Dmitriy Milovanov asked on February 8, 2018 20:55

So i upgraded to 9.0 successfully. Few weeks after i had to restore DB from backup of 8.2. I ran upgrade scripts again and i got this error "Invalid column name 'DocumentInheritsStylesheet'.". How do i only upgrade database and not the code?

Recent Answers

Trevor Fayas answered on February 8, 2018 23:13

You can try to find the upgrade zip and in there should be the SQL script, however I'll be surprised if this works alone as part of the upgrade is done by the files on the first start up, Soo you will most likely need to roll back both files and database and start again.

0 votesVote for this answer Mark as a Correct answer

Jan Šedo answered on February 9, 2018 10:45 (last edited on February 9, 2018 10:55)

After an upgrade, a finishing script has to run with the first site load to make some final database touches. It's not enough to just run the sql part to successfully upgrade the database, you have to make sure that UpgradeProcedure.cs runs as well. It's the part that logs and UPGRADE - FINISH event to your Event log, without it the upgrade is incomplete. Two options to try - 1) run the code manually or 2) one of the database settings flags (CMSDBVersion, CMSDataVersion) triggers this procedure to run. You can for example install fresh 8.2 and upgrade it to 9, not run it, and connect it do your db and the script would finalize your db upgrade. Or try to observe how the mentioned flags work during the upgrade and do some magic with your own db. Make sure to do backups at any step.

Of course the safest way to do it would be to roll back and do both again as Trevor mentions.

0 votesVote for this answer Mark as a Correct answer

sunil agrawal answered on February 9, 2018 18:50

You should check your 8.2 DB for temp_formdefinition table. If its there & there is a data in it that means your 8.2 site has not updated. You should manually run the upgrade method of UpgradeProcedure.cs class where we get Start & finish event when upgrade succeed.

0 votesVote for this answer Mark as a Correct answer

Dmitriy Milovanov answered on February 9, 2018 19:11

Unfortunately, roll back is not an option. The site is highly custom and i spent long time upgrading code. I will try executing UpgradeProcedure.cs manually.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.