Applying Kentico Hotfix

Julian C. asked on July 5, 2024 17:01

Environment: Kentico Xperience 13 on Microsoft Azure Virtual Machine

I'm trying to figure out an easier/faster way to apply hotfixes on Production (PROD) site after the Development (DEV) is updated.

I follow the hotfix instructions here (https://docs.kentico.com/13/installation/hotfix-instructions-xperience-13) but I feel like the process can be less complicated. Would you please share your steps, recommendations, tricks to apply hotfixes on PROD (with the least amount of downtime).

Few items to consider when responding:

  • What time of day you apply the hotfix on PROD.

  • How often you apply the hotfix? Every hotfix or just the refreshes.

  • How long it takes to apply the hotfix on PROD (how long the PROD site is down).

  • Do you copy all the MVC site files from DEV to PROD or just the updated .dlls under the BIN folder?

  • Do you stop the IIS site and the app pool before applying the hotfix?

  • Have you tried to manually apply the hotfix on admin site without the Hotfix Utility?

  • Major issues you encounter. Lessons learned.

Thank you in advance for your response.

Recent Answers


Juraj Ondrus answered on July 8, 2024 06:41

I just want to emphasize that it is a must to follow the instructions. Those are the required minimum. We do not write the instructions to be more complicated than needed. In the recent past there were several issues caused when the developer tried to shortcut the hotfix or simplify the process. Some errors will popup immediately, some after few days or weeks when it is not possible to roll back - and you may end up with inconsistent DB and even more work to be done to fix it.
Also, the hotfix does not update the DLL files only - sometimes the bigs are in the UI or other code files. You should always copy all the files, entire project. Sometimes the hotfix also removes code files - when leaving them, it can cause ambiguity and another issues.
Applying hotfix is up to you - if you are facing a fixed bug, you need to decide whether it is worthy for you to apply it. Hotfixes also contain security improvements - so it is really up to you. I would do it at least once in a month in a low traffic time - night or weekend.
The hotfix uses app_offline.htm file - so it stops the site. You do not need to stop the entire IIS/application pool. Just make sure no one/nothing will change data in the DB when applying hotfix. Applying hotfix on the project files is fast. Executing the SQL hotfix script depends on the DB size.
Do not forget to update the NuGet packages on the front end application - this is often missed and leads to API and data inconsistencies.

1 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on July 8, 2024 16:33

We've done hundreds if not thousands of hotfix applications and I can't stress what Juraj says enough.

In a multi-environment setup with CI/CD processes in place, we've found this to be the easiest approach to apply a hotfix to the CMS application:

DEV

  1. Make sure the website is stopped and app pool is stopped.
  2. Take a back up of your database.
  3. Run the hotfix tool locally on your machine connected to the remote Dev database.
  4. Commit the code changes to a feature branch, create a PR into dev, and allow the CI/CD process to deploy the built code to the website.

QA

  1. Navigate to the hotfix SQL folder on your local machine, typically something like: C:\Program Files (x86)\Kentico\13.0\Hotfix130_144\SQL
  2. Take a back up of your database.
  3. Open the Hotfix_default.sql file
  4. Make sure the website is stopped and app pool is stopped.
  5. Connect to your QA database and execute the Hotfix_default.sql file against your QA database
  6. Create a PR from the feature hotfix branch into the QA branch and allow the CI/CD process to deploy the built code to the website.

Prod

  1. Follow steps 2-6 in the QA section above but against your Prod database and branch.

If you don't have a CI/CD process in place, (I'd highly suggest looking into it) then replace the build and deploy process with whatever it is you use to build and deploy the website with.

If you are using an Azure Web App, you can set up deployment slots to perform these actions against but keep in mind you may want to have a database copy you connect your slot to so you can have 2 separate instances. Then once you are done, just swap the slots out and you should be good to go. For your info, there is a bit more involved in using slots than meets the eye so while I may make it sound simple, there are some areas that just don't work like you'd expect.

3 votesVote for this answer Mark as a Correct answer

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