Uninstall Sitecore Instance Manually

In this blog, I will let you know how to completely remove the Sitecore instance from your machine manually. While installing the new instance we face the error regarding SQL Server, Sitecore Identity Server, etc. To overcome this situation, perform the below steps to entirely clean the old Sitecore instance and you can go with a smooth installation of the new instance.

  1. Stop the IIS and remove the configuration:
  2. Open the IIS server and in the right panel Action tab click on Stop.

    uninstall-sitecore-1

    Again, in the left panel right-click on the Sitecore instance and choose the Remove option.

    uninstall-sitecore-2

    In the left panel go to the application pool, select all respective Sitecore Instance application Pool and choose the remove option from the right panel. For example, in this blog, I am deleting the "sc1011sc.dev.local" instance.

    uninstall-sitecore-3
  3. Delete Sitecore Service:
  4. Go to the Service window, Press the Win + R key, it will open the run window. Then, type "services. msc" and hit Enter.

    Go to your Sitecore instance services and stop services.

    uninstall-sitecore-4

    Open the command prompt in admin mode and delete all the respective services using command "SC DELETE servicename"

    uninstall-sitecore-5
  5. Delete the file system:
  6. In your local machine find the location of your Sitecore instance. Normally it's at location "C:\inetpub\wwwroot"

    Delete all the respective Sitecore instance folders.

    uninstall-sitecore-6
  7. Remove the entry from the host file:
  8. Go to the path of your host files entries. Enter the path in the Run window: "%windir%\system32\drivers\etc\hosts"

    Find the host entry of your Sitecore instance entry and delete those lines.

    uninstall-sitecore-7
  9. Delete the database:
  10. Open the SQL server and delete the related database of your Sitecore instance from the left panel. Right-click on each database and choose the delete option from the menu.

    uninstall-sitecore-8

    Or use the below script to delete the database and revise the script accordingly.

     USE master  
     DECLARE @scInstance SYSNAME , @sqlQuery VARCHAR(MAX)  
     SET @scInstance = 'sc1011' -- Your Sitecore instance name  
     SET @sqlQuery = 'DROP DATABASE {0}_Core  
      DROP DATABASE {0}_ExperienceForms  
      DROP DATABASE {0}_MarketingAutomation  
      DROP DATABASE {0}_Master  
      DROP DATABASE {0}_Messaging  
      DROP DATABASE [{0}_Processing.Pools]  
      DROP DATABASE {0}_ProcessingEngineTasks  
      DROP DATABASE {0}_ProcessingEngineStorage  
      DROP DATABASE {0}_ReferenceData  
      DROP DATABASE {0}_Reporting  
      DROP DATABASE {0}_Web  
      DROP DATABASE [{0}_Xdb.collection.Shard0]  
      DROP DATABASE [{0}_Xdb.collection.Shard1]  
      DROP DATABASE [{0}_Xdb.collection.ShardMapManager]  
      DROP DATABASE [{0}_EXM.Master]  
     '  
     SET @sqlQuery = REPLACE( @sqlQuery , '{0}', @scInstance )  
     EXEC( @sqlQuery )  
    
  11. Stop Solr service:
  12. Press the Win + R key, it will open the run window. Then, type "services.msc" and hit Enter. Go to your Solr service and stop service.

    uninstall-sitecore-9
  13. Delete the SOLR search indexes:
  14. Go to the Solr indexes directory on your machine. In my case, it's "C:\Solr\solr-8.4.0\server\solr" and delete all the Solr indexes related to your Sitecore instance. After that restart the Solr service again.

    uninstall-sitecore-10
  15. Delete Certificates:
  16. Execute the MMC command into the Run windows and open Microsoft Management Console. Select Add or Remove Snap-in option from the File Menu.

    Select Certificate Snap-in from the left panel and click on Add Button. In the next window go with the Computer Account option and click on the Next button.

    uninstall-sitecore-11

    You will get a list of all certificates. Find the name of the certificate with your Sitecore instance, right-click choose the delete option and remove all the certificates.

    uninstall-sitecore-12

Now, you are prepared to install the new Sitecore instance.

Happy Sitecoreing ðŸ˜Š

Comments

Popular posts from this blog

Sitecore Installation Error: Failed to Start Service 'Sitecore Marketing Automation Engine'

Import CSV Data in Sitecore Using PowerShell: Part-3

Sitecore : The database principal owns a schema in the database, and cannot be dropped message