Error Deleting Web Application (AGAIN)

Last Friday, I upgraded our 2010 SharePoint Farm to 2013. I had done it in development many times and wrote down all steps and caveats for a smooth upgrade. Once the time hit (6pm on a Friday), I began the upgrade process. Everything went smoothly except for our Forms Based Authentication site. When I ran the command to attach/upgrade: Mount-SPContentdatabase -Name -WebApplication http://webapplicationurl, it said the upgrade completed with errors. I thought it may have been some leftover references to the Forms Based Authentication Tool that was installed but retracted before doing the backup (Awesome tool by the way, you can download it here) but when I checked the upgrade log, it actually showed that the upgrade session Failed! Oh no. I checked the web application in central admin but it showed no content databases attached to the web application. Double “Oh no!”. My next step was to try to attach and upgrade again.

ERROR – a database with the same id already exists… but where was it? It wasn’t showing in the web application. Finally, I tried to delete the web application (both via central admin and also powershell) and again, errors.

An object in the SharePoint administrative framework, “SPWebApplication Name=WEBAPP”, could not be deleted because other objects depend on it. Update all of these dependants to point to null or different objects and retry this operation. The dependant objects are as follows:

Except there were no dependent objects listed. After researching my error, I found this technet posting and followed what Eric VanRoy suggested. I did not need to query the config database though and just found my GUID by using the GET-SPDatabase powershell command. Here’s what I did:

GET-SPdatabase (note down the db id – it may show as an empty name)
$db=Get-SPDatabase -id
$db (this step verifies it’s the correct DB as the Name field should be NULL)

After the database was deleted, I deleted the Web Application and was able to create a new one, perform the attach and upgrade, and voila! It worked this time. I have no idea what caused the failure the first time around though.



Leave a Reply

Your email address will not be published. Required fields are marked *