Although is Windows Server 2012 R2 “old” OS, before few weeks I had to license evaluation version of Windows Server 2012 R2. Process is very simple, but change the license key requires use of CLI instead GUI. By Microsoft, that is not “just” licensing, that is upgrade to Windows Server 2012 R2.
At the first step, you need to check current edition and what are possible editions for upgrade. In command prompt or PowerShell run command DISM /online /Get-CurrentEdition. Output will show you information about current edition.