verb
BAD : He offered to replace the old battery by a new one.
GOOD : He offered to replace the old battery with a new one.
◆◆◆
replace sb/sth with sb/sth (NOT by ): 'The firm has been dismissing experienced staff and replacing them with school leavers.'