Optimized migrate process

This is a proof-of-concept patch to improve migration speed by keeping the project state between migrations and mutate the state instead of systematically recreate a new state.