Speed up migrate script