migration: use switch at the end of migration