Update
It looks like the issue is due to the following MySQL statement:
UPDATE cmsTemplate SET master = NULL WHERE 'master' IS NOT NULL AND 'master' NOT IN (SELECT nodeId FROM (SELECT * FROM cmsTemplate a) b)
Any ideas on how to make the above query compatible with MySQL?
Original Issue
We are having the following error when trying to upgrade our Umbraco installation (Server Core 2012 R2 / MySQL Database):
2016-12-07 15:49:25,532 [P5184/D5/T42] ERROR Umbraco.Web.Install.Controllers.InstallApiController - Installation step DatabaseUpgrade failed.
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> Umbraco.Web.Install.InstallException: The database failed to upgrade.
ERROR: The database configuration failed with the following message: An error occurred running a schema migration but the changes could not be rolled back.
Error: You can't specify target table 'cmsTemplate' for update in FROM clause. In some cases, it may be required that the database be restored to it's original state before running this upgrade process again.
Please check log file for additional information (can be found in '/App_Data/Logs/UmbracoTraceLog.txt') at Umbraco.Web.Install.InstallSteps.DatabaseUpgradeStep.Execute(Object model) --- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) at Umbraco.Web.Install.Controllers.InstallApiController.ExecuteStep(InstallSetupStep step, JToken instruction)
Any ideas how to resolve?
Many thanks,
Steve