Uninstall Sitecore 9

Sitecore 9 is here!

Sitecore 9 launched earlier this month with a bunch of exciting new features to celebrate, as well as a fair number of fundamental changes to the way in which developers are going to need to work with it. One of the most immediately obvious of these is the new Sitecore Install Framework, an extensible PowerShell module that supports both local and remote installations of Sitecore. So far, I've only had experience with the former but aside from a few teething problems (that have largely been down to my own fairly sparse knowledge of PowerShell) it's been pretty fun to work with.

Sitecore 9 Installation - When things go wrong

One thing that I did notice however was that if for some reason cough, typos in my parameters cough, the installation fails, you typically have to manually unpick everything in order to get your environment nice and clean and ready for a fresh install (unless you are using VMware, in which case just spin up another box). It can take time getting the pre-requisites for Sitecore 9 sorted out (e.g. getting Solr running SSL locally) and putting together your own deployment scripts and JSON configuration files using SIF, so the chances of small mistakes causing an error on running the install are fairly high the first time around. Get any of these steps wrong either when setting up the pre-requisites or when trying to unpick a failed installation, e.g. leaving a service running or forgetting to stop a website in IIS and you can encounter issues re-running the Install-SitecoreConfiguration cmdlet from the Sitecore Install Framework. These typically revolve around processes still being in use and are quite straightforward to sort out but can be time-consuming to unpick.

All in all, in a typical local setup you will now have:

  • Application Pool and Website for Sitecore
  • Application Pool and Website for Sitecore Xconnect
  • Webroot (typically inetpub\wwwroot) directories for the above two sites
  • Solr Cores for all indexes
  • 2 Windows Services
    • Sitecore Marketing Automation Engine
    • Sitecore XConnect Search Indexer
  • 2 Windows Processes for indexing and marketing automation
  • 12 SQL databases
  • Obligatory host file entries

Unpicking the Installation

I have written a simple PowerShell script available here that unpicks all of these things and gives you back a clean environment - my PowerShell is pretty rudimentary so feel free to suggest some improvements / make some contributions! The only things it won't do yet are removing the Solr installation, SSL certificate and Solr services, as those typically won't need to be removed/replaced with each installation. The script is called like so:

.\Uninstall-SitecoreConfiguration.ps1 -Prefix yoursiteprefix -SitecoreSiteName yoursiteprefix.local -SolrService yoursolrservicename -PathToSolr C:\Solr\solr-6.6.0\apache-solr -SqlServer .\SQLSERVER -SqlAccount sa -SqlPassword password123!

Sitecore 9's deployment onto a server is now more multifaceted than it used to be, thanks to a different, more distributed architecture (a good thing), Solr running locally and in particular the new Xconnect service layer (a really good thing). In turn, SIF is encouraging us Sitecore developers to become more hands-on with PowerShell and other command-line interfaces/ modules besides SIF. Hopefully this script will help make life easier for anyone else getting into working with SIF and the new toys in Sitecore 9.

UPDATE: 02/12/2017 - this has now been re-written as a SIF module. Please see here for more details