This assumes a clear interface. Which assumes that you get the interfaces right - but what's the chance of that if the code needs rewriting?
Most substantial rewrites crosses module boundaries. In micro services changing the module boundary is harder than in a monolith, since it can be done in a single commit/deploy.