I think every Web developer, who works on a few projects at the same time, knows how difficult it is to make a decision on reinstalling an operating system. You’ll need to reinstall IIS, Application Pools, Sites, host etc. You may suggest that we use backup tools that back up IIS settings before reinstalling and restoring them after the OS is reinstalled. And it works. However, things have become more complicated with Sitecore 9. Along with standard IIS configuration we have at least two windows services to restore after the OS is reinstalled: Sitecore XConnect Search Indexer and Sitecore Marketing Automation Engine. Also, there is Sitecore Processing Engine service since Sitecore 9.1. If you want your Sitecore instance to work correctly after the operating system is reinstalled, you’ll need to ensure that these services are installed and are running, as well as application pool and website in IIS. Don't forget about indexes and databases.
The last time I felt that my OS is dying, I invented a way to restore all my environments. The following steps needed to be done before re-installation:
The steps above have to be done for each website that you are going to restore in the future.
After all preparations are done, you can reinstall your OS. Once it is done, the following module need to be downloaded to help us to recover our instances: Recovery Tool (a source code is available on github).
Archive contains the list of files that represent a configuration for SIF to recovery App_Pools, Websites, Windows Services, Solr cores:
Follow the steps below to prepare your environment to install Sitecore instance:
Register-PSRepository -Name SitecoreGallery -SourceLocation https://sitecore.myget.org/F/sc-powershell/api/v2 Install-Module SitecoreInstallFramework Install-SitecoreConfiguration -Path .\Prerequisites.json
When the installation is complete, you might be informed that a server reboot is required. The steps above are pretty standard and always require for first Sitecore installation.
Follow the steps below to recover your previous Sitecore instance:
Once the recovering is finished, you will have your Sitecore instance restored. Recovery Tool does the following:
Also, the tool has the opposite functionality. Let’s say you have a temporary unused Sitecore instance. For example, as a Sitecore developer, I have about eight sitecore instances installed on my machine. But I use regularly only two of them. To save my laptop resources, I want to temporarily remove unused instances. And the tool can help me with that. Follow the steps below:
Once the execution is finished, selected Sitecore instance will be removed. Recovery Tool in this mode does the following:
Then, you can easily restore your Sitecore instance using the tool again.