Showing posts with label Windows Server. Show all posts
Showing posts with label Windows Server. Show all posts

Monday, 3 September 2012

Uninstalling SQL Server from Windows 2008 R2 server core

How hard can it be to uninstall SQL Server from Windows Server 2008 R2 core?

It should be straight forward but first I had to find the magic uninstall command - setup.exe which is located in the Setup Bootstrap\SQLServer2012 folder in the folder that SQL server 2012 was installed in to in the first place. On my machine this is C:\Program Files\Microsoft SQL Server\110\Setup Bootstrap\SQLServer2012.

It took me some time but eventually I found the following command worked
setup /action=uninstall /FEATURES=SQL,Tools,RS,AS,IS /INSTANCENAME=MSSQLSERVER /UIMODE=EnableUIOnServerCore.
I tried using /QS instead of /UIMODE=EnableUIOnServerCore but it couldn't find any features to uninstall!

It also allowed me to select all of the components including the shared components - which is the only way I found to remove all of them apart from the native client.

To remove the Native Client use:
msiexec /uninstall {49D665A2-4C2A-476E-9AB8-FCC425F526FC}

It does leave a few log files and empty directories floating around but they are easily cleaned up.

Monday, 2 July 2012

Recovering a Windows 2008R2 server with a dead motherboard

Background

Earlier this week our Windows 2008 R2 based domain server started having random crashes and then finally it would not even restart to the BIOS screen.

We have regular backups so we were not unduely worried and thought that this would be an ideal time to update the server hardware especially as we didn't have any hardware that was remotely similar to the existing server.

Method

My first attempt was to make a copy of the disk (all the partitions using Clonezilla) and the try and boot the new hardware from this copy. Unfotrunately all that happened was the monitor would flash and the machine restarted to the recovery options screen. It didn't seem to matter what options I selected it made no difference.

Next I tried booting to DSRM and restored the server with exactly the same result!

Finally, I copied the disk again and this time I used the information I found after searching the internet some more in Mark Minasi's forum. He has a lot of very interesting information in his forums for sys ops and I should have remembered to chek there first. His descriptions are usually much much better than Microsofts.

It turned our all I needed to do in the recovery console was:

  1. do bcdedit /v to get the GUID of the OS entry you're booting.
  2. With that guid, type
    bcdedit /set {FILLINTHEGUIDHERE} detecthal on
  3. Ran regedit
  4. Navigated to HKLM
  5. Selected File, Load Hive (Note: Must be under HKLM first, or this option will be greyed out)
  6. Navigated to C:\Windows\System32\Config\SYSTEM
  7. Loaded hive HKEY_LOCAL_MACHINE (which mounts as a sub-hive)
  8. changed Restored_HKLM\ControlSet001\services\msahci\Start to 0
  9. Select File, Unload Hive (may need to select the hive node in HKLM)
  10. Restart

And it WORKED. All I had to do now was install some missing drivers off the new computers CD and re-activate the licence.

Conclusion

The steps are very simple once you know how. The hardest bit of this whole thing was actually getting the information.