Indonesian Haryanto, 23, signed at the start of the season but has failed to secure financial backing and has now been offered the reserve role.
Frenchman Ocon will race alongside German Pascal Wehrlein for the remaining nine rounds of the F1 season.
"I'm ready for this exciting step up," said Ocon.
Wehrlein earned the British-based F1 team their first point at the Austrian GP in July, and they are currently 10th in the constructors' standings.
Racing director Dave Ryan said: "We're confident that when Esteban makes his Grand Prix debut in Spa, we will have a very potent line-up with which to take the fight to our immediate competitors for the rest of the season."
Haryanto, who had been backed by Indonesia's state-owned oil company Pertamina, become the first driver from the country to race in F1.
Pertamina and the Indonesian government had managed to secure enough for him to race in the first half of the season, but were struggling to raise more money.
"Unfortunately we reached a point where, in the best interests of the team, we were forced to explore other options for the remainder of the season," Ryan explained.
Renault's 19-year-old reserve driver Esteban Ocon has replaced Rio Haryanto at Manor and will make his Grand Prix race debut in Belgium on 28 August.