Run migration in a thread