Unable to run SharePoint configuration wizard - Error”Unable to upgrade SharePoint Products and Technologies because an upgrade is already in progress."

This article is about an error generated when running configuration wizard in WSS 3.0 / MOSS 2007. The scenario is like this. The SharePoint environment was running with WSS 2.0 and tried to upgrade to WSS 3.0. The WSS 2.0 was installed with a default instance of SharePoint Database (Express /Embedded edition of SQL) and while upgrading the SQL instance got corrupted. But the SharePoint was still considering the timer service in progress . But looking at the Timer job status in Central administration the upgrade timer job was not progressing and it got stuck at a point.

As we need to create a new Config DB , we have tried detaching the server from farm. It was giving this error message


The reason behind this was the timer job was in stuck state and unable to progress that in intern made any changes to config DB not successful.

The steps that can be taken forward to correct the issue is :-

1. Stop the Windows SharePoint Services Timer service.
2. On the SharePoint Server where Central Administration Site is hosted browse to C:\Documents and Settings\All Users\Application Data\Microsoft\SharePoint\Config\<guid>
3. Move all the xml files to another location.
4. Also backup the cache.ini file. Then Edit the cache.ini and replace the current value with "1".
5. Restart the Windows SharePoint Services Timer service. New xml files will start appearing in the guid folder.
6. Verify the cache.ini now contains its previous value (or verify that the value is no longer "1"; any non-1 value is fine).
7. Run the command from the sharepoint server "stsadm -o setproperty -pn command-line-upgrade-running -pv no" (without quotes)
8. Run the command from the sharepoint server "stsadm -o execadmsvcjobs" (without quotes)
9. Run the command from the sharepoint server "psconfig -cmd upgrade -inplace b2b -wait -force" (without Quotes)
10.Run configuration wizard and disjoin from farm