implement migrate command