The Sharks announced both deals Friday, one day before the start of the NHL season.
Sheppard has played 34 games this season with Worcester of the AHL with eight goals and 15 assists.
In 224 career NHL games with Minnesota, Sheppard has 11 goals and 38 assists. He was acquired by the Sharks on Aug. 7, 2011, for a third-round pick in this year's draft.
Petrecki played in 16 games this season with Worcester and had one goal and two assists. In 68 games last season with Worcester, Petrecki had a goal and eight assists.
Petrecki, chosen by San Jose with the 28th pick in the 2007 draft, hasn't played an NHL game.