Timeout expired error when executing SQL upgrade/hotfix script

   —   
When upgrading your CMS instance or applying the hotfix using the KIM or upgrading/hotfixing tool, you may get a timeout expired message when the SQL script is being executed. This article explains the reason, and how to avoid it.
When upgrading your CMS instance or applying the hotfix using the KIM or upgrading/hotfixing tool, you may get a timeout expired message when the SQL script is being executed. This article explains the reason, and how to avoid it.

The exact error message in the log is:
Failed to run SQLscript: Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.

This error is caused by the execution of the SQL script taking longer to complete, than the Connection Timeout value set in the connection string of your CMS’s web.config file.  This is especially true for the upgrade SQL script which has thousands of lines that need to be executed, and depending on the size of the DB, the execution time can vary from a few seconds, to several minutes.

If you already received this error message, the best approach is to roll back the DB changes by using the database backup of the previous version, and run the DB upgrade once again (if you haven’t upgraded yet, you can use either of these options):
  1. Run only the SQL script from the upgrade package using SQL Server Management Studio to avoid time outs or,
  2. Extend the time out settings in the application’s web.config file in the connection string property.
For no.1, If you are using KIM, the upgrade/hotfix package is downloaded to:
c:\ProgramData\KIM\ (hidden) directory into respective upgrade/hotfix number folder. You need to run the exe file to extract the files into c:\Program Files (x86)\KenticoCMS\<version_number>\ directory again under the respective upgrade/hotfix number folder. There you can find the SQL script file.
-jo-


Applies to: Kentico CMS Versions 5.5.R2, 6.x, 7.x and later
Share this article on   LinkedIn