If a machine can replace something, or has innovated something, we adapt to the innovation and replace the procedure or utility that it has innovated.
In our history, we replaced arrows with bullets, stones with metal, and so much more.
But Magic, for me, might be difficult to replace, as Magic is immeasurable as currently we provide proofs based on Science, and we measure something based on science (It is the magic of technology)
So, In your world, when could the people replace the magic they posses with technological advancements?
You have to provide first the limitations when using magic.
If a mage could cast a fire spell which also causes his hands to burn and decay, then he might replace the said spell by just using a flame thrower, a rocket, or a nuclear missile depending on how much power he wishes. If a water breathing spell makes the user look like a fish if used it for long periods of time, then a scuba diving equipment, or snorkel can replace the said magic.
Coexistence of technology and magic could happen too. As long as your the boundaries of your magic is nullified by your technology. Technology could also provide protection from magic, provided if the limitation of the magic is negated by your technology.