The Vertical first reported the terms of the trade.
Ibaka joined the Magic during the offseason when he was traded from the Oklahoma City Thunder for Victor Oladipo and No. 11 pick Domantas Sabonis.
Orlando had felt in recent weeks that Ibaka might leave in free agency this summer. Without assurances he would stay, the Magic weighed offers from several teams, including the Raptors and Miami Heat, before agreeing to the trade.
Toronto is confident it can re-sign him this summer, a source told ESPN's Ramona Shelburne.
"I think he's a great addition," Raptors point guard Kyle Lowry said. "I think he's a great addition to any team and especially to ours where we can add some shot blocking. Some outside shooting, some inside toughness, some athleticism running up and down the floor. I think he's gonna be a guy that can take some pressure off of me and DeMar [DeRozan]."
DeRozan said of Ibaka, "He's definitely one of a kind. When it comes to rim protection, being able to score in the post, and also space the floor as well. It sucks to see T [Ross] go, but now we got to make this new adjustment with a great new addition."
A source close to Ibaka told Shelburne that he had begun to have misgivings about the way he was being used by Magic coach Frank Vogel and the long-term direction of the franchise amid growing uncertainty over general manager Rob Hennigan's future.
The 6-foot-10 Ibaka was averaging 15.1 points, 6.8 rebounds and 1.6 blocks per game for the Magic this season.
"Serge has been to a Finals, he's been to the Western Conference Finals, he's played with an MVP [in Kevin Durant], he's played with a possible MVP [in Russell Westbrook]," Lowry said. "He knows how to play the game of basketball."
Ross moves to the Magic after averaging 10.4 points and 2.6 rebounds in 22.4 minutes per game for Toronto.
ESPN's Nick Friedell contributed to this report.