Mars doesn't need a magnetic field, it needs a new atmosphere, 78 percent nitrogen, 22 percent oxygen. Both gases can be obtained in the outer solar system, and perhaps even closer. Once introduced, it will take 100,000 or more years for the solar wind to strip the entire thing, if that's even A) feasible and B) related to the magnetic field of the planet.
A magnetic field is also very helpful for keeping solar radiation lower.