The Millers made the perfect start after 12 minutes when Michael O'Connor's free kick was cleared straight back to him and his cross was headed down by Alex Revell to Kieran Agard, who turned smartly in the box to fire his shot past Jon McLaughlin.
Within a minute, City thought they had the perfect answer, but James Hanson's close-range header was ruled out for a foul on goalkeeper Adam Collin.
The Millers could easily have increased their lead but two smart saves from McLaughlin within a minute denied Matt Tubbs and Revell.
The visitors were incensed they did not get a penalty when Raffael De Vita had his shirt pulled, but it took a third good save from McLaughlin just before the break to deny Revell doubling the home side's lead.
But the second goal did come in the 62nd minute. A free kick on the ange of the area was driven hard and low across the box by O'Connor and Revell turned the ball in from close range with a smart finish.
And number three was only eight minutes in coming, Agard's looping header going over McLaughlin and into the net from the outstanding O'Connor's centre to seal the passage into round two.