[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Migrating MS SQL 2k8 license from one machine to another

Posted on 2014-07-15
6
Medium Priority
?
179 Views
Last Modified: 2014-07-22
We have an old server with MS SQL 2008 on it that we want to move to a new server.  We would like to use the same license.  Originally, when the old server was sold to us we were given no documentation.  How do we dig up the license from the old server?  I'm assuming this is like MS Office where you get a key and just reinstall using the same key.  However, I can't seem to find the key...  Any advice on what to do in this situation?
0
Comment
Question by:Tim Phillips
  • 3
  • 3
6 Comments
 
LVL 9

Expert Comment

by:RantCan
ID: 40198043
Try magical jelly bean
 http://www.magicaljellybean.com/keyfinder/
There are a few other apps that will do the same. Belarc advisor is another one. You can install SQL in a 180 day trial mode while you get this sorted.
0
 
LVL 6

Author Comment

by:Tim Phillips
ID: 40198119
Just tried MJB and it didn't find anything and neither did Belarc.
0
 
LVL 9

Expert Comment

by:RantCan
ID: 40198154
Here is a list of 20 or so, with links,
http://pcsupport.about.com/od/productkeysactivation/tp/topkeyfinder.htm

And here is a small program some cat wrote to decode SQL 2008's key from the registry.
http://www.branchbits.com/blog/2010/01/sql-server-2008-product-key/
0
Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

 
LVL 6

Author Comment

by:Tim Phillips
ID: 40202446
I tried a few of those and the "small program", but nothing worked.  Any other ideas?
0
 
LVL 9

Accepted Solution

by:
RantCan earned 2000 total points
ID: 40203353
I found this on:
http://social.msdn.microsoft.com/Forums/sqlserver/en-US/87949b5a-21ae-49bc-b942-57ff64fe464c/how-to-find-out-existing-sql-product-key-and-replace?forum=sqlsetupandupgrade

Run the Powershell script below on your SQL server:

function Get-SQLserverKey {
    ## function to retrieve the license key of a SQL 2008 Server.
     param ($targets = ".")
    $hklm = 2147483650
    $regPath = "SOFTWARE\Microsoft\Microsoft SQL Server\100\Tools\Setup"
    $regValue1 = "DigitalProductId"
    $regValue2 = "PatchLevel"
    $regValue3 = "Edition"
    Foreach ($target in $targets) {
        $productKey = $null
        $win32os = $null
        $wmi = [WMIClass]"\\$target\root\default:stdRegProv"
        $data = $wmi.GetBinaryValue($hklm,$regPath,$regValue1)
        [string]$SQLver = $wmi.GetstringValue($hklm,$regPath,$regValue2).svalue
        [string]$SQLedition = $wmi.GetstringValue($hklm,$regPath,$regValue3).svalue
        $binArray = ($data.uValue)[52..66]
        $charsArray = "B","C","D","F","G","H","J","K","M","P","Q","R","T","V","W","X","Y","2","3","4","6","7","8","9"
        ## decrypt base24 encoded binary data
        For ($i = 24; $i -ge 0; $i--) {
            $k = 0
            For ($j = 14; $j -ge 0; $j--) {
                $k = $k * 256 -bxor $binArray[$j]
                $binArray[$j] = [math]::truncate($k / 24)
                $k = $k % 24
         }
            $productKey = $charsArray[$k] + $productKey
            If (($i % 5 -eq 0) -and ($i -ne 0)) {
                $productKey = "-" + $productKey
            }
        }
        $win32os = Get-WmiObject Win32_OperatingSystem -computer $target
        $obj = New-Object Object
        $obj | Add-Member Noteproperty Computer -value $target
        $obj | Add-Member Noteproperty OSCaption -value $win32os.Caption
        $obj | Add-Member Noteproperty OSArch -value $win32os.OSArchitecture
        $obj | Add-Member Noteproperty SQLver -value $SQLver
        $obj | Add-Member Noteproperty SQLedition -value $SQLedition
        $obj | Add-Member Noteproperty ProductKey -value $productkey
        $obj
    }
}
0
 
LVL 6

Author Comment

by:Tim Phillips
ID: 40212939
Ended using the current version of SQL 2012 Express as it meets our needs.  The script wouldn't work for me.  Good try though.
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Long way back, we had to take help from third party tools in order to encrypt and decrypt data.  Gradually Microsoft understood the need for this feature and started to implement it by building functionality into SQL Server. Finally, with SQL 2008, …
In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Integration Management Part 2
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question