Recovering from a failed upgrade