public async Task <IActionResult> Migrate([FromHeader] string key) { if (!Validate(key)) { return(Unauthorized()); } try { var userManager = serviceProvider.GetService <UserManager <ApplicationUser> >(); await DataMigrator.MigrateV1(dbContext, userManager, configuration.GetConnectionString("ClimbV1")); return(Ok()); } catch (Exception exception) { logger.LogError("Failed migrating data.", exception); return(StatusCode(500, exception)); } }