The former England Under-21 international has spent the last four seasons at the KC Stadium.
Welsh, 25, began his career at Liverpool and made his debut at the age of 18 before joining Hull in the 2005/06 campaign.
Last season he spent time on loan at Carlisle and Bury and Rovers manager John Barnes said: "It is great to have a player of John's quality in the squad.
"He is a hard-working central midfielder, a good tackler and distributor of the ball.
"I'm pleased he has agreed to join us."