Error Upgrading from 4.5 to 4.6

9 months ago
Hi,

I have a weird error occurring when I try to upgrade my live site.

I delete all the 4.5 files, copy in the 4.6 files and then copy appsettings.json & plugins.json

I start the site and when I browse to it I get a 500 error.   I look in the stdout logs and I see it has updated the database then I see a warning...

Error unprotecting the session cookie.
      System.Security.Cryptography.CryptographicException: The key {b718c8e7-74e1-426e-b987-15f988a53914} was not found in the key ring

Then I see an error

fail: Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware[1]
      An unhandled exception has occurred while executing the request.
      Microsoft.Data.SqlClient.SqlException (0x80131904): Invalid column name 'ConversionsApiEnabled'.
      Invalid column name 'PixelScriptEnabled'.
      Invalid column name 'AccessToken'.

After this one attempt to load the site a whole load of files disappear from the site.  If I try to copy the source files back into the folder I get a message telling me 6318 of the 6839 files already exist.  I have no idea what happened to the remaining 521 files.

I have tried restoring and attempting it again but I get the same result.

If anyone can give any advice on what is causing this or how to fix it I would really appreciate it.

Many Thanks
9 months ago
RE: "I delete all the 4.5 files, copy in the 4.6 files and then copy appsettings.json & plugins.json"
Probably, "delete" is not a good thing to do.  Better to just set up a new folder, and adjust the web site settings.  (although I'd probably create a new test site first too ;)

RE: " Error unprotecting the session cookie."
Trying clearing all you browser cookies.  (Or, try using an Incognito / in-private browser first)

RE: " Invalid column name '..."
It seems like Migrations did not run.  Not sure why.  Check the System Log for other errors.  Query the MigrationVersionInfo table.

I'd recommend you first set up a brand new vanilla 4.60 site & DB.  After you confirm it works, you can make adjustments to appsettings and plugins json files, and restart the site.
9 months ago
"RE: "I delete all the 4.5 files, copy...."   When I say delete all files I mean I remove all the 4.5 files and replace with the 4.6 files.  I obviously have a backup of all files & database.  I used these to rollback when the upgrade failed.

"RE: Error unprotecting the session cookie."   I did try this and I tried a different browser but got the same results.

"RE:  Invalid column name .."  From what I can see the site crashed during the upgrade.  Some db objects were updated but other were not.

"I'd recommend you first set up a brand new vanilla "  This works fine on a test domain but not on the live domain.  Using the live database I can also bring the site on a test domain.  Its only on the live domain I have a problem. The test and live domain are on the same server.

I have installed the site on a test domain a number of times now with no problems.  I have also tried installing the site on a test domain and then switching the home directories in IIS for the live and test sites (and editing the settings). The site gave me a 500 error but did not log anything anywhere (Event Logs, stdout logs, IIS logs)    

I am starting to lean towards an IIS problem at the moment but to be honest, I am not sure of anything.

Thanks
9 months ago
Just wanted to share the problem I found…..

My whole problem installing the NOP upgrade was due to a SSL certificate problem. There were two certificates on the same domain. One GeoTrust and one Lets Encrypt, the site gave no indication there was any problem until I went to upgrade the NOP version.  I removed the Let’s Encypt certificate and NOP has now installed correctly.