Tuesday, June 17, 2014

SQL 2012 Upgrade - "Rule 'Previous Upgrade' failed." Error

SQL upgrade to SQL 2012 had failed at the first attempt and it gives error- "Rule 'Previous Upgrade' failed. A previous upgrade that failed was detected. To retry the upgrade, remove the upgraded feature that failed, and then run the upgrade again."  -on re-attempt.

Fix-1 - correct and the best way


1) Open a command prompt and navigate to 2012 install directory
For me it is D:\SQL2012Sp1\
2) Run the command “setup.exe /Action:RunDiscovery” as per the screenshot below


3) It opens the report in a web page like the one below

4) So here it shows
Database Engine Services = Version 11.0.2100.60
Full-Text and Semantic Extractions for Search = Version 11.0.2100.60
Installed but same time they do exist in Windows 2008 also because last upgrade failed.

So we need to un-install these two before we attempt to upgrade Windows 2008 again.
You can do it via below mentioned commands or using the GUI un-install window.

5) Setup.exe /Action=Uninstall /Instanceid=MSSQL11.MSSQLSERVER /Features=SQL /Q
Make sure that you change /Incanceid and /Features based on your Discovery Report.
In the command above command “/Features  = SQL” will remove Engine, Replication, Full Text and Data Quality this is what I had to run as Database Engine and Full-Text Search are the once listed in my Discovery Report.
You can use like “/FEATURES=SQL,AS,RS,IS,Tools” if you also have SSAS, SSRS, SSIS or SQL Tools listed in the discovery report.
6) Once it is removed, run the discovery report again to make sure that the 2012 features are completely removed and run the upgrade again.

Fix-2 (If Fix 1 is't helpful)


Here is what you have to do

1) Open Regedit
2) Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
3) Check though the Keys and look for "SQL Server 2012 Database Engine Service"

4) Once found, match "DisplayVersion" and "InstanceId" with the discovery report to double check.
5) Once that's confirmed, open "ModifyPath" and copy the value to a note pad










6) Add /X in the string
Note: /X is for uninstall
7) Open a command prompt and run the command











8) Yes to confirm and uninstall the product.

I my example, have to uninstall Full-Text Search also so,

1) Refresh the regedit screen and you will not be able to see "SQL Server 2012 Database Engine Service" now
2) I have to look for "SQL Server 2012 Full text search" and i found it here




















3) I have copied the Modify path and ran the uninstall command with /X switch to uninstall Full Text search also.

That's it!
Now we should be able to run 2012 upgrade again.

Good Luck!
R.Hari.

1 comment:

Anonymous said...

Hi Harry,
Thanks a lot for sharing your experience and mostly providing a solution to this issue.
I was upgrading a 2008R2 Express to a 2014 Standard and got the same error and with your help I was able to remove the failed installation, reboot and then retry the upgrade which worked just fine after that.
Edhy!!!