Clyde have been rewarded for their first-round win over Ayr with a trip to face the winners of the August 5 clash between Rangers and Hibernian.
Hearts have been handed a trip to nearby Livingston while Highland League champions Brora Rangers have received a home tie against East Fife following their victory over Stenhousemuir.
Petrofac Training Cup second-round draw
Dunfermline or Raith Rovers v Falkirk
Brora Rangers v East Fife
Brechin v Peterhead
Stirling v Alloa
Livingston v Hearts
Rangers or Hibernian v Clyde
Morton v Berwick Rangers
Stranraer v Albion Rovers