Added first version of restore function when upgrade fails.