"The lure of returning to the SPL with such a great club as Aberdeen was a major factor," said the 26-year-old former Kilmarnock star.
"I've really enjoyed my time at Oldham, but now I can't wait for the new season to get underway."
McDonald is likely to be a straight replacement for the departing Barry Nicholson as Jimmy Calderwood begins his rebuilding plans for next season.