If you need to upgrade a server running Windows Server 2008 R2 Standard to either the Enterprise, or Datacenter editions you can use the installation image and choose the Upgrade option or the new command-line utility, introduced in Windows Server 2008 R2, DISM (Deployment Image Servicing and Management). With DSIM it is possible to perform the upgrade online, without the need to reinstall Windows or have the installation image.
To perform the upgrade in-place online, without the media image, first open an elevated command prompt (run as administrator) on the server to be upgraded.
Type the command DISM /Online /Get-CurrentEdition. This will display the current Windows version.
Type the command DISM /Online /Get-TargetEditions to list the Windows editions to which this server can be upgraded.
Type the command DISM /Online /Set-Edition: <TargetEdition> (replace <TargetEdition> with the syntax for the desired edition returned by Get-TargetEditions).
If you receive a message (Error 87) indicating that you need to specify a product key you can include it with the /ProductKey: parameter
If you receive a message (Error 50) indicating that Setting an Edition is not supported then the machine may be a Domain Controller (DC) and it must be demoted before performing an online upgrade. You do not need to demote it if you are using the installation image.
As always, be certain that you back up all of your settings and data prior to performing the upgrade.