It will be easier to make mars habitable than to move earth.
If you have millions of years you could completely terraform Mars.
To add a whole new atmosphere to Mars by bombarding it with icy rocks from the asteroid belt.
Then building a magnetic coil around mars to stop energetic radiation from entering its atmosphere
In addition to doing the long tedius work of terraforming mars, which will include things like
- washing surface soil to remove salts so that it can be used for agriculture
- Increase atmospheric pressure to minimal human breathing level
- Balance the atmospheric chemistry so that humans can breathe (higher O2 levels depending on pressure)
- Find and/or genetically plants and animals that can populate mars
All of that will be done quicker and easier than to move earth any noticeable distance away from the sun.
That said, if we have the technology and infustructure to move earth away from the sun, we would have terraformed mars as well.