1- Demote the DC using the dcpromo /forceremoval.
2- Remove the server from the PDC using Active Directory Users and Computers, flagging the “this domain controller is pemanently offline and can no longer be demoted using the active directory domain services installation wizard (DCPROMO)” checkbox. It is not necessary to clean with ntdsutil the metadata. These operations are included with the deletion of the domain controller from the GUI.
3- Remove the AD role.
4- Reinstall the AD role.
5- Promote the DC using dcpromo