The Fenway Park outfit were in the hunt to regain Lester's services, after the Oakland Athletics poached him during the 2014 season following the 30-year-old's eight years in Boston.
But Lester, a free agent, chose to switch to the Chicago Cubs on a franchise-record six-year, $155million contract.
Boston general manager Ben Cherington claimed his side would have been happy to have Porcello in place of Lester in mid-year.
"If we had known in July we weren't going to sign Jon Lester, I think we would have been happy to trade for Rick Porcello,'' Cherington said.
"We're excited to have Rick on board.''
Caught up in the Lester whirlwind has been Yoenis Cespedes, the outfielder traded from the A's to Boston for Lester in July - and has now been sent from the Red Sox to Detroit for Porcello's services.
Boston also gave up relief pitcher Alex Wilson and teenager Gabe Speier to secure Porcello.
The Red Sox are also in the market to trade for Arizona Diamondbacks pitcher Wade Miley - a left-hander - and right-handed pitcher Justin Masterson, a free agent.