I failed one portion of the MD exam. Do I have to retake both sections

No, you can just retake the portion that you failed. You'll still need to submit a new registration form to PSI with the $44 testing fee.