The 21-year-old joined Stanley in June 2015 from Derby County and made 24 appearances last season.
He played in both legs of the League Two play-offs as Stanley lost 3-2 to AFC Wimbledon in extra-time.
"It is important we get players who understand the league who are real quality and Ross ticks that box," boss Darren Ferguson told the club website.
Accrington will be owed compensation for Etheridge, as he is under the age of 24 and was offered a new contract to remain at the club.
Doncaster were relegated to League Two on the final day of the season as they finished 21st in League One.
Find all the latest football transfers on our dedicated page.
Doncaster Rovers have signed Accrington Stanley goalkeeper Ross Etheridge on a two-year deal starting on 1 July.