Carr has plied his trade at Basford since October 2016 after joining from Grantham.
Shaw said: "I am so pleased to be able to bring Lewis to the club. He is a really impressive man with how he carries himself on and off the pitch and fits the profile perfectly for the role within the group that he will play."
"He has played a lot of games at this level at the top end of the division and brings a wealth of experience.
"He is mobile and athletic and that will allow us to defend how we want to defend with his physicality.
"He will partner a younger centre half next season so his character, personality and nous will hugely benefit those around him."
"I feel this signing shows the pull of Gainsborough as a football club, its fan base and reputation along with the way we will be working this season have attracted Lewis ahead of potentially better offers financially."
Carr added: "I am delighted to sign with Gainsborough. It’s a fantastic club with great fans! Cant wait to get started next season.”
The signing comes days after Trinity signed Cieron Keane – a 24 year old left back who has capped ten times by the Republic of Ireland at U19 level.
Keane, who signed from Stafford Rangers, has made over 100 appearances at this level and above.
Shaw added: "Cieron adds more pace, athleticism and energy to our group to continue our recruitment of players with top end physicality for the level. He is a really talented player who is looking for a platform and some stability in his career.
"He will give us drive and enthusiasm down the left side to match Joe Wilson on the other flank and I think we can carry a real threat from full back areas.
"He has a lovely left foot and his set piece delivery and crossing will create lots of goal scoring opportunities."