Semantics – What is the difference between a migration pattern and a refactoring?

Usually they are not the same.

Remodeling: "The process of changing a software system so that it does not change the outer behavior of the code but improves its internal structure" – (by Martin Fowler)

migration is the process of moving data and / or logic to a completely new implementation.

The intent behind refactoring is a series of small, targeted changes that can easily be undone. At least that's how it was originally sold. The concept is that it is much smaller in size than a full description of the entire sale, so it is also less risky.

In the context of your question, your definition of "refactor" is essentially a rewrite that provides the same functions as the monolithic application. It is better to understand these terms:

  • Refactor is the "what"
  • Migration is the "how"

When you reshape parts of your monolithic application, you migrate the code in the monolithic application that was used to run the function to call the microservice that you created to replace that code. If necessary, the data managed by the monolithic application is migrated to the data store used by the microservices.