At some point either during development or setup of a farm, you might have to remove SharePoint 2013 and re-install. Like 2010, the SharePoint uninstall does so pretty cleanly but with some caveats.
For one (just like 2010), the SharePoint databases are not removed. This is so that you can remove a server from the farm without affecting others. However, if you are truly removing SharePoint (i.e. a single server or to do a re-install), you have to manually delete all of the DB’s created for the various services, etc. directly using SQL Server Management Studio. This includes the SharePoint Config database.
However, SharePoint 2013 also installs a number of other services within the SharePoint 2013 Products Preparation Tool – one of these happens to be the Microsoft AppFabric 1.1 for Windows Server. AppFabric was developed for Azure and is a set of integrated technologies that makes it easier to build, scale, and manage Web and composite applications that run on IIS. SharePoint 2013 makes use of these services (thus why required) through the Distributed Cache Service.
When removing SharePoint 2013, it can have an adverse impact on the AppFabric setup. SharePoint creates its own ‘Cache node’ to coincide with SharePoint. This directly affects the web.config files across the system and sites. It doesn’t ALWAYS happen but when it does, it’s a real pain.
The problem comes in when you attempt to re-install SharePoint; it would appear that the AppFabric settings are not picked up during the new installation which unfortunately causes both to fail. You can get SharePoint installed, but you’ll see problems when you attempt to add Services like the Access Service. Unfortunately, SharePoint simply gives you one of those simplistic “error has occurred” pages and looking into the ULS log doesn’t give you much. In most cases, it will simply indicate ‘access is denied’ even when you are logged in as the Farm Administrator account.
If you do have this problem, the quick fix here is to uninstall SharePoint then uninstall AppFabric 1.1 but of course, there is a gotcha. If you attempt to remove the AppFabric, it will indicate that it will not delete the existing configuration (i.e. settings in the web.config files).
So, I am not a big fan of messing with web.config files, especially with SharePoint (since it keeps the web.config in the DB anyway), it turns out Microsoft was wise enough to provide us with a UI tool to do this. Full details can be found under the MSDN article here: http://msdn.microsoft.com/en-us/library/ff637683(v=azure.10).aspx.
More useful are the cleanup instructions found here: http://msdn.microsoft.com/en-us/library/ff637741(v=azure.10).aspx – in this article, it includes a link to the AppFabric Uninstall Cleanup Tool – this is a small application that will do the cleanup for you and prevent having to manually edit anything.
So you might think you are all set – au contraire! Turns out that the AppFabric uninstall has a bug! Oh what fun!
So to sum it up, a proper uninstall/re-install (again, when you have this problem – if the AppFabric is working, no need for this) is as follows from start to finish:
1) Uninstall SharePoint 2013 from the web front end
2) On SQL Server, delete any databases that were created by the previous installation (or locally if using SQL Express)
3) Uninstall AppFabric 1.1 from the web front end
4) Use the AppFabric Uninstall Cleanup Tool to remove the web.config entries (again on the web front end server)
5) Reboot the web front end server
6) Login to the front end server and from the SharePoint 2013 Setup, run the SharePoint 2013 Products Preparation Tool – this will detect that the AppFabric is missing and try to install it again
7) When the process completes, it will ask for a reboot; on restart it will start up again – however here’s where it gets tricky:
- If the process runs through, starts up on reboot and simply finishes, you are fine.
- If the process starts up again and tries to install the AppFabric (again) then asks for a reboot, the problem is that the AppFabric uninstall didn’t complete. In effect, the Prep tool will continually run at startup and ask for a reboot every time (but AppFabric WILL NOT be installed). So when this happens, you have to do some additional steps to clear it out:
- First verify in the Prep Tool message window that there were no changes
- Open the “Start” folder (All Programs > Start), right click on the Microsoft SharePoint 2013 Products Preparation Tool link and delete it:
OR do a reboot and just when the Prep Tool starts click Cancel then reboot again
When logging in after the reboot, the Prep Tool should not restart
- Now back to why AppFabric has a problem – it turns out that in the background, the AppFabric installation is failing with an “MSI Error 1603 installing AppFabric 1.1” (you’d see that if you tried to install AppFabric by itself) – to fix this:
- Open the Registry Editor (Start > Run… > Regedit) (disclaimer: make a backup before you make changes – if you don’t know how, you should get someone that does!)
- In the registry editor, find the ‘PSModulePath’ ** key HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Control/Session Manager/Enviroment/PSModulePath – you can search for PSModulePath but make SURE you have the path correct (there is more than one!)
- Delete the PSModulePath key:
- Reboot the server
- Login to the front end server and from the SharePoint 2013 Setup, run the SharePoint 2013 Products Preparation Tool – this should again detect that the AppFabric is missing and try to install it again – when complete it will request a reboot
- On the restart, login again – this time the Prep tool should complete and when you click Finish will NOT require a reboot
** BTW: Kudos to Lucas Massena for finding the AppFabric 1.1 uninstall bug fix: http://social.msdn.microsoft.com/profile/lucasmassena/?type=forum&referrer=http://social.msdn.microsoft.com/Forums/en/velocity/thread/561f3ad4-14ef-4d26-b79a-bef8e1376d64
8) When the Prep tool completes successfully, you can re-install SharePoint from scratch including creating new databases for the install
Good luck on this one!
Sterling International Consulting Group is a specialist in enterprise systems including architecture, governance, business continuity, and disaster recovery planning with over 28 years in IT and management consulting. SICG also has a dedicated practice in SharePoint Technologies and Microsoft Technologies. From planning to analysis to development to deployment, SICG has the experience and knowledge to understand the best for your business – find out why: [email protected] – www.sterling-consulting.com.
Keep up with the latest articles and tips around SharePoint from author & CEO David Sterling via http://www.sharepoint-blog.com and his personal blog site:http://davidmsterling.blogspot.com or contact him directly at [email protected].