Thursday, May 27, 2010

How to completely remove SQL 2005 for DPM reinstall.

This is specifically for Windows Server 2008 Enterprise 64bit with Microsoft Data Protection Manager 2007 and SQL 2005 SP2 but I see no reason why it wouldn’t work on any version of Windows Server, with or without DPM and for probably any service pack level of SQL 2005.  This will remove all databases and config and put you back to ground zero.  Be sure to have backups if necessary first.

Ever try to uninstall Microsoft Data Protection Manager with SQL 2005 on the same machine and then reinstall it?  It doesn’t work very well mostly because SQL Reporting Services doesn’t completely uninstall.  The reinstallation of DPM won’t get past the prerequisite check.  Even though you may have uninstalled SQL from Add/Remove Programs, not everything is gone.  References to the MS$DPM2007$ database are still present, mostly in the registry.

After countless hours of research and trying all kinds of methods I finally found a way to do it.  I took pieces from several different forums and guides and came up with a solution.

I was trying to pull the old database back in but it was too corrupt and would crash the system each time.  So I got plenty of practice with this complete uninstall method and it worked every time.  The official instructions from Microsoft to uninstall SQL 2005 Manually ( is difficult to follow and the way I describe is easier and more complete.  This method worked for me because I wanted to go back to zero to start again.  If you are not trying to do the same, I suggest you find another way.  Follow these directions at your own risk.

Step 1. Backup what you want to keep first.  Then stop all SQL component and DPM services in services.msc.

Step 2. Uninstall from Add/Remove Programs.  DPM always uninstalled fairly well from Add/Remove programs.  SQL usually uninstalled but not close to completely.  If one of the SQL components won't uninstall, don't worry we will remove it all through the registry.  Restart after this step.

Step 3. Delete the DPM and SQL folders from wherever you installed them to.  Usually at:
C:\Program Files\Microsoft DPM
C:\Program Files\Microsoft SQL Server
C:\Program Files (x86)\Microsoft SQL Server

Step 4. Open IIS Manager and under the Default Web Site, remove both Reports and ReportServer directories.  Then go up to Application Pools and remove the ReportServer app pool.

Step 5. ****Warning: editing the registry is dangerous****  Some of this taken from Gilham Consulting wesite (  
Time to open Regedit.exe and delete some keys.  Remove the following keys if they are still present:
HKLM\SYSTEM\CurrentControlSet\Services\MSRS 2005 Web Service
HKLM\SYSTEM\CurrentControlSet\Services\MSRS 2005 Windows Service
HKLM\SOFTWARE\Microsoft\Microsoft SQL Native Client
HKLM\SOFTWARE\Microsoft\Microsoft SQL Server
HKLM\SOFTWARE\Microsoft\Microsoft SQL Server 2005 Redist
HKLM\SOFTWARE\Wow6432Node\Microsoft\Microsoft SQL Native Client
HKLM\SOFTWARE\Wow6432Node\Microsoft\Microsoft SQL Server

Step 6. Do a search in regedit for the InstanceName$ of your SQL instance if you know what it is.  If this is a Microsoft DPM server, your instance name will be MS$DPM2007$.  If you find one and it is a value, not a key, press ctrl+tab to move to the key and then delete the whole key.  If they are under LEGACY keys you won't be able to delete them and they are fine.  There may be 4 or 5.  Close out of regedit.

Step 7. Download and install Little Registry Cleaner (  Open this little app and let it scan the registry.  It will find several leftovers.  You can look through and select or de-select the ones you want.  These are broken links that it finds and it should be safe to remove them all.  Press the Fix button to have them removed.  Restart the server.

Step 8. Your server is now free of SQL and you can begin installing again.  DPM will make it past the pre-reqs for SQL now and as long as there aren't other issues not covered by this post, you should be able to reinstall DPM now.

Reference links:

    Exchange 2007 - Administratively set mailbox send and receive size limits

    These commands can be used in the Exchange Management Shell to set the MaxSendSize and MaxReceiveSize for all mailboxes at once.  If you use a number like 20480, that will set it as KB.  Or you can use MB at the end to shorten it.

    get-mailbox | set-mailbox -MaxSendSize 20MB
    get-mailbox | set-mailbox -MaxReceiveSize 20MB

    One or more users cannot be added to the folder access list. Non-local users cannot be given rights on this server.

    Exchange 2007
    If you are trying to add a mail-enabled distribution or security group to a resource such as a shared calendar or task list and you may get the error "One or more users cannot be added to the folder access list.  Non-local users cannot be given rights on this server."

    If you can't do it from within that shared resource mailbox you may be able to do it from a regular user mailbox that has full access to that shared resource mailbox.  Then in Outlook with that user mailbox go to Tools, Account Settings, Change, More Settings, Advanced tab, and add that resource mailbox.  Click Ok, Next and Close out.  Now you have access to that mailbox on the left column of Outlook.

    Open the Folder view so you can see all the folder and then right click on Tasks or Calendar or the folder you want to add permissions to.  Go to Properties and the Permissions tab.  Now you should be able to add your mail-enabled distribution or security group to this resource.