Tuesday night's result set up a trip to League One Coventry for Jim Bentley's Shrimps.
A dire first half short on incident ended well for the visitors as they snatched the lead two minutes before the break.
Rochdale defender Rhys Bennett was off the pitch receiving treatment following a bang to the head when Izak Reid whipped in a cross.
Lewis Alessandra made the most of the defender's absence, sending a powerful header goalward and, though goalkeeper Josh Lillis was able to parry, he did so into the path of McDonald - who slotted the simplest of finishes home from five yards.
Andrew Fleming should have doubled the lead moments into the second half when he rose unchallenged to meet Alessandra's centre and sent his effort over.
The closest Rochdale came to scoring was a miscued cross from Dele Adebola, Morecambe stopper Barry Roche backpedalling to protect his goal.