STSADM Uninstall

September 17th, 2009 | Categories: STSADM | Tags:

The most dangerous unpublished command in SharePoint is STSADM –O UNINSTALL. This is not  provided nor recommended by Microsoft.

BE AWARE TO USE THIS COMMAND. BY MISTAKE NEVER USE THIS COMMAND IN YOUR BOX. Once you hit the command, it not only mess up your entire SharePoint environment, but also mess up so many things so that you can not REMOVE SHAREPOINT AND INSTALL AGAIN in a easy step by step manner.

This article is to aware you about the stages happened while hitting stsadm –o uninstall, so that, ou guys keep yourself away from uninstall SharePoint using this way. I use this test in single box with 3 site collection and 1 GB of total database size.

Unsaid Story of STSADM:

I was very much prepared on one fine morning to hit and test UNINSTALL command. And I also had a small test farm (through which basically I enjoy the sanity and unit testing). First I went through the SharePoint sites and other site collection and it looks like fine. Everything was in peace and the site was working perfectly.


In the TEMPLATE folder, everything was fine, and all the OOB was working perfectly.

So, the next step was to hit the UNINSTALL command. Browse to the STSADM directory i.e. the path <Instalation Drive>\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN. In my end it was C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN.

I checked and see Microsoft recommended only uninstallfeature STSADM command. No more uninstall command was present. Below the existing uninstall STSADM commands.

Now, I was prepared and executed the uninstall command by typing STSADM –o uninstall.

My initial though was, it will uninstall features, site, collection, web application, content database(s) and config database. And I was able to see the steps one by one. Unfortunately that was not happened. Within a minute, the process WAS STOPPED without throwing any information.

To check the site collection, I opened IE and put the Team Site url there and got the error PAGE CANNOT BE DISPLAYED.

First thing I check the logs and it was so long. I found many of the stuff were uninstalled.

Logs:

STSADM.EXE stsadm: Unextending the virtual server: http://ggl/   (GGL was the server name)
STSADM.EXE The virtual server’s version is null or its major version is not same as product’s version, so do not unextend it
STSADM.EXE stsadm: Unextending the virtual server: http://ggl:24135/
STSADM.EXE Unprovisioning Iis Web Site P2U
STSADM.EXE Successfully invoked metabase method Recycle
STSADM.EXE Invoking metabase method stop.
w3wp.exe   AppDomainUnloadListener.Stop(False) called. ShutdownReason=HostingEnvironment, this=15368010
w3wp.exe   AppDomainUnloadListener.Stop() entered lock(this=15368010)
w3wp.exe   AppDomainUnloadListener.Stop() about to AcquireWriterLock(), this.countdownSeconds=120
w3wp.exe   AppDomainUnloadListener.Stop() finally{} block with (timedOut == false), ensured that all LRO thread finished
STSADM.EXE Unprovisioning the metabase path, IIS://localhost/w3svc/1037924182/Root/_layouts
STSADM.EXE Unprovisioning the metabase path, IIS://localhost/w3svc/1037924182/Root/_layouts/images
STSADM.EXE Unable to unprovisioned metabase object IIS://localhost/w3svc/1037924182/Root/_layouts/inc: System.Runtime.InteropServices.COMException (0×80070003): The system cannot find the path specified.       at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail)     at System.DirectoryServices.DirectoryEntry.Bind()     at System.DirectoryServices.DirectoryEntry.get_AdsObject()     at System.DirectoryServices.DirectoryEntry.DeleteTree()     at Microsoft.SharePoint.Administration.SPMetabaseObject.Unprovision()


STSADM.EXE Unprovisioning the metabase path, IIS://localhost/w3svc/1037924182/Root/_wpresources
STSADM.EXE Unprovisioning the metabase path, IIS://localhost/w3svc/1037924182/Root/_controltemplates
STSADM.EXE Removing the asp.net *script map from P2U.
STSADM.EXE Removing core web.config settings from P2U.
STSADM.EXE Removing services.cnf from virtual directory of P2U.
STSADM.EXE Removing version information from service.cnf in virtual directory of P2U.
STSADM.EXE The application pool, P2U, is in use and cannot be deleted.
w3wp.exe   Now terminating ULS (w3wp.exe, Microsoft.Office.Server.Native.dll)
w3wp.exe   Now terminating ULS (w3wp.exe, onetnative.dll)
STSADM.EXE Solution Deployment : Removing feature for pagebranding.wsp during WebAppUnextend 635816dc-5b54-479e-95e9-8386eda1eba7
STSADM.EXE Updating SPPersistedObject SPXmlDocCacheRefreshSentinel Parent=SPFarm Name=SharePoint_Config_5b189ea8-41ba-4b60-a560-fc5c100d174e. Version: -1 Ensure: 1, HashCode: 49972132, Id: 586e0958-c3f4-46bf-adda-c348467914d4, Stack:    at Microsoft.SharePoint.Administration.SPPersistedObject.Update()     at Microsoft.SharePoint.Administration.SPPersistedObject.Update(Boolean ensure)     at Microsoft.SharePoint.SPXmlDocCacheRefreshSentinel.FlushAllCachesInFarm(SPFarm farm)     at Microsoft.SharePoint.Administration.SPFeatureDefinition.Delete() at Microsoft.SharePoint.Administration.SPPersistedChildCollection`1.Remove(Guid id) at Microsoft.SharePoint.Administration.SPFeatureDefinitionCollection.Remove(Guid featureId, Boolean force)     at Microsoft.SharePoint.Administration.SPSolutionPackage.R…
STSADM.EXE …emoveFeatureDefinitions()     at Microsoft.SharePoint.Administration.SPSolutionLanguagePack.OnUnextendWebApp(Guid webAppId, String[] vdirs, String[] serverComments, Boolean webAppUnprovision)     at Microsoft.SharePoint.Administration.SPSolution.RetractSolutions(SPFarm farm, Guid webAppId, String[] vdirs, String[] serverComments, Boolean lastVdir)     at Microsoft.SharePoint.Administration.SPGlobalAdmin.UnextendVirtualServer(SPVirtualServer vs, Boolean bDropContentDB, Boolean bDropIisSites) at Microsoft.SharePoint.Administration.SPGlobalAdmin.UnextendVirtualServer(SPVirtualServer vs, Boolean bDropContentDB)     at Microsoft.SharePoint.StsAdmin.SPUninstall.Run(StringDictionary keyValues)     at Microsoft.SharePoint.StsAdmin.SPStsAdmin.RunOperation(SPGlobalAdmin globalAdmin, String strOp…
STSADM.EXE …eration, StringDictionary keyValues, SPParamCollection pars)     at Microsoft.SharePoint.StsAdmin.SPStsAdmin.Main(String[] args)
STSADM.EXE Updating SPPersistedObject SPXmlDocCacheRefreshSentinel Parent=SPFarm Name=SharePoint_Config_5b189ea8-41ba-4b60-a560-fc5c100d174e. Version: 10066 Ensure: 0, HashCode: 49972132, Id: 586e0958-c3f4-46bf-adda-c348467914d4, Stack:    at Microsoft.SharePoint.Administration.SPPersistedObject.Update()     at Microsoft.SharePoint.SPXmlDocCacheRefreshSentinel.FlushAllCachesInFarm(SPFarm farm)     at Microsoft.SharePoint.Administration.SPFeatureDefinition.Delete()     at Microsoft.SharePoint.Administration.SPPersistedChildCollection`1.Remove(Guid id)     at Microsoft.SharePoint.Administration.SPFeatureDefinitionCollection.Remove(Guid featureId, Boolean force)     at Microsoft.SharePoint.Administration.SPSolutionPackage.RemoveFeatureDefinitions()     at Microsoft.SharePoint.Administration.SPSolutionLa…
STSADM.EXE …nguagePack.OnUnextendWebApp(Guid webAppId, String[] vdirs, String[] serverComments, Boolean webAppUnprovision)     at Microsoft.SharePoint.Administration.SPSolution.RetractSolutions(SPFarm farm, Guid webAppId, String[] vdirs, String[] serverComments, Boolean lastVdir)     at Microsoft.SharePoint.Administration.SPGlobalAdmin.UnextendVirtualServer(SPVirtualServer vs, Boolean bDropContentDB, Boolean bDropIisSites)     at Microsoft.SharePoint.Administration.SPGlobalAdmin.UnextendVirtualServer(SPVirtualServer vs, Boolean bDropContentDB) at Microsoft.SharePoint.StsAdmin.SPUninstall.Run(StringDictionary keyValues)     at Microsoft.SharePoint.StsAdmin.SPStsAdmin.RunOperation(SPGlobalAdmin globalAdmin, String strOperation, StringDictionary keyValues, SPParamCollection pars)     at Microsoft.Sha…
STSADM.EXE …rePoint.StsAdmin.SPStsAdmin.Main(String[] args)
OWSTIMER.EXE Flushing the xml document cache.
OWSTIMER.EXE Flushing the xml document cache.
OWSTIMER.EXE Flushing the xml document cache.
w3wp.exe     Flushing the xml document cache.
STSADM.EXE   Failed to find the XML file at location ‘12\Template\Features\MasterPageSplash\feature.xml’
w3wp.exe     Flushing the xml document cache.
w3wp.exe     Flushing the xml document cache.
w3wp.exe     Flushing the xml document cache.
STSADM.EXE   Updating SPPersistedObject SPXmlDocCacheRefreshSentinel Parent=SPFarm Name=SharePoint_Config_5b189ea8-41ba-4b60-a560-fc5c100d174e. Version: -1 Ensure: 1, HashCode: 47096010, Id: 586e0958-c3f4-46bf-adda-c348467914d4, Stack:    at Microsoft.SharePoint.Administration.SPPersistedObject.Update()     at Microsoft.SharePoint.Administration.SPPersistedObject.Update(Boolean ensure)     at Microsoft.SharePoint.SPXmlDocCacheRefreshSentinel.FlushAllCachesInFarm(SPFarm farm)     at Microsoft.SharePoint.Administration.SPFeatureDefinition.Delete()     at Microsoft.SharePoint.Administration.SPPersistedChildCollection`1.Remove(Guid id)     at Microsoft.SharePoint.Administration.SPFeatureDefinitionCollection.Remove(Guid featureId, Boolean force)     at Microsoft.SharePoint.Administration.SPSolutionPackage.R…
STSADM.EXE   …emoveFeatureDefinitions()     at Microsoft.SharePoint.Administration.SPSolutionLanguagePack.OnUnextendWebApp(Guid webAppId, String[] vdirs, String[] serverComments, Boolean webAppUnprovision)     at Microsoft.SharePoint.Administration.SPSolution.RetractSolutions(SPFarm farm, Guid webAppId, String[] vdirs, String[] serverComments, Boolean lastVdir)     at Microsoft.SharePoint.Administration.SPGlobalAdmin.UnextendVirtualServer(SPVirtualServer vs, Boolean bDropContentDB, Boolean bDropIisSites)     at Microsoft.SharePoint.Administration.SPGlobalAdmin.UnextendVirtualServer(SPVirtualServer vs, Boolean bDropContentDB)     at Microsoft.SharePoint.StsAdmin.SPUninstall.Run(StringDictionary keyValues)     at Microsoft.SharePoint.StsAdmin.SPStsAdmin.RunOperation(SPGlobalAdmin globalAdmin, String strOp…
STSADM.EXE   …eration, StringDictionary keyValues, SPParamCollection pars)     at Microsoft.SharePoint.StsAdmin.SPStsAdmin.Main(String[] args)
STSADM.EXE   Updating SPPersistedObject SPXmlDocCacheRefreshSentinel Parent=SPFarm Name=SharePoint_Config_5b189ea8-41ba-4b60-a560-fc5c100d174e. Version: 12005 Ensure: 0, HashCode: 47096010, Id: 586e0958-c3f4-46bf-adda-c348467914d4, Stack:    at Microsoft.SharePoint.Administration.SPPersistedObject.Update()     at Microsoft.SharePoint.SPXmlDocCacheRefreshSentinel.FlushAllCachesInFarm(SPFarm farm)     at Microsoft.SharePoint.Administration.SPFeatureDefinition.Delete()     at Microsoft.SharePoint.Administration.SPPersistedChildCollection`1.Remove(Guid id)     at Microsoft.SharePoint.Administration.SPFeatureDefinitionCollection.Remove(Guid featureId, Boolean force)     at Microsoft.SharePoint.Administration.SPSolutionPackage.RemoveFeatureDefinitions()     at Microsoft.SharePoint.Administration.SPSolutionLa…
STSADM.EXE   …nguagePack.OnUnextendWebApp(Guid webAppId, String[] vdirs, String[] serverComments, Boolean webAppUnprovision)     at Microsoft.SharePoint.Administration.SPSolution.RetractSolutions(SPFarm farm, Guid webAppId, String[] vdirs, String[] serverComments, Boolean lastVdir)     at Microsoft.SharePoint.Administration.SPGlobalAdmin.UnextendVirtualServer(SPVirtualServer vs, Boolean bDropContentDB, Boolean bDropIisSites)     at Microsoft.SharePoint.Administration.SPGlobalAdmin.UnextendVirtualServer(SPVirtualServer vs, Boolean bDropContentDB)     at Microsoft.SharePoint.StsAdmin.SPUninstall.Run(StringDictionary keyValues)     at Microsoft.SharePoint.StsAdmin.SPStsAdmin.RunOperation(SPGlobalAdmin globalAdmin, String strOperation, StringDictionary keyValues, SPParamCollection pars)     at Microsoft.Sha…
STSADM.EXE   …rePoint.StsAdmin.SPStsAdmin.Main(String[] args)
OWSTIMER.EXE Flushing the xml document cache.
w3wp.exe     Flushing the xml document cache.
w3wp.exe     Flushing the xml document cache.
w3wp.exe    Flushing the xml document cache.
STSADM.EXE  Failed to find the XML file at location ‘12\Template\Features\SplashPage\feature.xml’
OWSTIMER.EXE Flushing the xml document cache.
STSADM.EXE  Deleting the SPPersistedObject, SPFeatureDefinition Name=FeatureDefinition/6ec50a02-f886-45ed-aa6d-a3eea2179437 Parent=SPFarm Name=SharePoint_Config_5b189ea8-41ba-4b60-a560-fc5c100d174e.
…………………………………………………………………………….
…………………………………………………………………………….

I went further and try to open the Central Administration GUI. Got an error specifying that “SharePoint Central Administration Web Application is not created yet….”, and it was redirecting me to the SharePoint configuration wizard.

In the configuration wizard, again throw me an error saying “An IIS web site by the name of SharePoint Central Administration V3 already exist in this server…”. Basically was saying that IIS web application was not deleted and configuration wizard was unable to proceed.

So the process was ended up there and there was one log file for me.

Logs:

An exception of type Microsoft.SharePoint.PostSetupConfiguration.PostSetupConfigurationTaskException was thrown.  Additional exception information: An IIS web site by the name of SharePoint Central Administration v3 already exists on this server. This name is reserved for the SharePoint Central Administration Web Application.  The web site must deleted or renamed before the SharePoint Central Administration Web Application can be created.


Microsoft.SharePoint.PostSetupConfiguration.PostSetupConfigurationTaskException: Exception of type ‘Microsoft.SharePoint.PostSetupConfiguration.PostSetupConfigurationTaskException’ was thrown.
at Microsoft.SharePoint.PostSetupConfiguration.CentralAdministrationSiteTask.Validate(Int32 nextExecutionOrder)
at Microsoft.SharePoint.PostSetupConfiguration.TaskCommon.BuildServerRoleSingleServerTaskExecution(Int32& nextExecutionOrder, TaskBase task)
at Microsoft.SharePoint.PostSetupConfiguration.StandAloneConfigurationTask.Validate(Int32 nextExecutionOrder)
at Microsoft.SharePoint.PostSetupConfiguration.SetupTask.Validate(Int32 nextExecutionOrder)
at Microsoft.SharePoint.PostSetupConfiguration.TasksQueue.Validate(Boolean useDefaultExecutionOrder)
at Microsoft.SharePoint.PostSetupConfiguration.PsconfigBaseForm.ValidateConfigurationData()
at Microsoft.SharePoint.PostSetupConfiguration.WelcomeForm.TryValidateConfigurationDataIfServerRoleSingleServer()

Entering function PsconfigMessageBox.ShowMessageBox
Leaving function PsconfigMessageBox.ShowMessageBox
Entering function StringResourceManager.GetResourceString

……………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………..………………………………….

Next task I had done is manually delete entire SharePoint web application from the server.

The same process again needs to follow. So open the configuration wizard. Now, this time it was asking to overwrite the existing settings or create a new SharePoint.

On this step, I selected to overwrite the existing one and proceed. The process has been started and passes the step1.

On the steps 2, while trying to connect with configuration database, it again failed. Throw System Error code 997.

The basic issue was in the setup process, it was still considering the same config and content databases name and found it is still exist and throws you the error.

Log error was “The parameter admincontentdatabase is NOT chosen, so returning the default value as SharePoint_AdminContent_ae4b1aee-27a5-4465-8082-61c6ccf50e85“.

Therefore the default database name again was clashing and the configuration process was end up on STEP 2. The question was how to overcome this situation. In this box, there was no SQL enterprise manager. Analyzing the log, I have found the SQL database MDF and LDF files.

To delete the existing configuration and content databases, it was required to STOP the services. Steps is OPEN SQL Server Configuration Manager and STOP SQL SERVER i.e. OFFICESERVERS.

Now, the individual database MDF\LDF file was at the location C:\Program Files\Microsoft Office Servers\12.0\Data\MSSQL.2\MSSQL\DATA in my testing box

Deleted the same from there and proceed again for configuration wizard. This time the screen and the process looks like different. It was saying to disconnect from the server, and  I had no other option except doing so :)

Step 1 went on, Step 2 went on…and so one….I was thinking I could get the error in the next phase. But I was luck that wizard again made me wrong and it went successfully.

Again, the problem was occurred on STEP 5 , at the registration of search services.

Log error was “System.IO.DirectoryNotFoundException …..Program Files\Microsoft Office Servers\12.0\Data\Office Server\Config…….“. There was also another error you may found “the process token believes that account ‘SERVER\Administrator’ (i.e. in which account you are installing) is not a member of WSS_ADMIN_WPG or WSS_WPG. Hence, we add the user explicity t the COM permission ACL.

How to overcome these error. Initially I was trying to add new CONFIG database to overcome this issue, but that was not the root cause and actual procedure I understood a little latter. So, the foremost action is to ADD the adequate permission to the WSS_ADMIN_WPG and WSS_WPG group.

Next task again very complicate and hard one. Manual removing of all the SharePoint entry from the REGISTRY. Make sure if you have SharePoint dssigner, that should not be mess up with this process.

And again you need to try to install the OfficeServer.EXE. Finally I got this screen. I was happy to see after a long journey :)

The lesson learned from this operation is not use STSADM -o UNINSTALL command any more.

Even not in your dream :)

  1. August 19th, 2010 at 06:15
    Reply | Quote | #1

    Thats some good basics there, already knew some of that, but you can always learn . I doubt a “kid” could put together such information as dolphin278 suggested. Maybe he’s just trying to be “controversial? lol