Change version from Standard to Datacenter Server 2019

Do the following inside an elevated command prompt.

Get the current Edition:

dism.exe /online /Get-CurrentEdition

Get the targeted Editions:

dism.exe /online /Get-TargetEditions

Change to a different Edition:

dism.exe /online /Set-Edition:ServerDatacenter /AcceptEula /ProductKey:XXXXX-XXXXX-XXXXX-XXXX-XXXXX