Case : After testing your Windows 2019 Server (Standard or Datacenter) Evaluation you want to go retail without installing the server from scratch
Run theses commands from Administrator PowerShell.
Check the version you’re currently running :
DISM /online /Get-CurrentEdition
Check the version you can upgrade to
DISM /online /Get-TargetEditions
To upgrade from Evaluation to Standard :
DISM /Online /Set-Edition:ServerStandard /ProductKey:XXXXX-XXXXX-XXXXX-XXXXX-XXXXX/AcceptEula
To upgrade from Evaluation to DataCenter
DISM /Online /Set-Edition:ServerDataCenter /ProductKey:XXXXX-XXXXX-XXXXX-XXXXX-XXXXX/AcceptEula
Reboot and enjoy.