FOXBORO, Mass. — After a five-plus-year journey that included stops in six different NFL cities, Brian Hoyer officially returned to New England on Wednesday.

Hoyer essentially swapped places with Jimmy Garoppolo this week, signing a three-year contract with the Patriots after Garoppolo (Tom Brady’s backup for the past three and a half seasons) was traded to the San Francisco 49ers. The 49ers released Hoyer, who began his career with the Patriots, after finalizing the Garoppolo deal.

The 32-year-old signal-caller made his Patriots practice debut (or return) Wednesday, beginning the process of re-familiarizing himself with an offense that has undergone some slight changes since he left Foxboro in 2012.

“Brian’s a smart guy,” Patriots offensive coordinator Josh McDaniels said. “He’s obviously got some years in our system and our terminology. So it’ll be kind of a cram session here, but I don’t expect that to take forever, because Brian’s an intelligent guy that had plenty of exposure to what we do, and I know he’ll work hard. So hopefully, we’ll catch him up really quickly.”

Hoyer signed with the Patriots as an undrafted free agent in 2009 and played for them through the 2011 season. He was released during final roster cuts in 2012 after losing the backup job to second-year pro Ryan Mallett.

McDaniels was absent for most of Hoyer’s tenure — he coached the Denver Broncos in 2009 and 2010 and spent the 2011 season as the St. Louis Rams’ offensive coordinator — but worked with him during the 2011 playoffs and 2012 offseason and preseason.

“I think the foundation of our system is the same,” McDaniels said. “There’s certainly things that have changed since he was here, for sure, but it’s just like learning a new language. Generally, they’re not going to change the language entirely. You might have to learn a new word here or there or something like that, which I’m sure Brian will be able to do quickly. But the foundation of our system and what we used and what we’ve done since he left has not really been that different.”

Hoyer, who, like McDaniels, hails from northeast Ohio, embarked on a football odyssey in 2012. He spent time with the Pittsburgh Steelers, Arizona Cardinals, Cleveland Browns, Houston Texans, Chicago Bears and 49ers, starting at least one game for five of those teams but never lasting more than two seasons in any one spot.

After losing his starting job to rookie C.J. Beathard earlier this season and his roster spot to Garoppolo, a Patriots reunion seemed like a foregone conclusion.

“He’s a really smart kid,” McDaniels said. “He’s from Ohio, so I have a fondness for those guys. He’s a football kid. He’s all about football, loves the game, cares about playing quarterback the right way. Smart guy, works hard, good teammate. So there’s a lot to like. I spent a short amount of time with him, and I’m looking forward to working with him here going forward in the second half of this season.”

Hoyer, who wore No. 8 in his first stint with the Patriots, will wear No. 2 this time around — a number last worn by Doug Flutie in 2005.