Add use_migrate flag and add nios sync logic