replace (someone or something) by (someone or something)
To substitute a person or thing in the place of someone or something; to provide someone or something that assumes the function, role, or status of someone or something. A less common variant of "replace (someone or something) with (someone or something)," except in passive constructions. They're looking to replace the manager with someone who is a bit better educated. I feel like we're all going to be replaced by machines someday.
replace someone or something by someone or something
and replace someone or something with someone or somethingto remove someone or something and add someone or something in place of the first. The manager replaced two workers by a machine. Walter replaced his old lawn mower with a newer one.