Also if cfg_backup doesn't exist, and cli is not enabled, shouldn't you copy from the cart.  That would mean you don't need to handle this in upgrade as well.