In step 5, don't you have the source/destination backwards? You are copying from data-bak (corrupted data) to data (restored data), whereas, I thought the point of all this was to copy from your restored data to your data-bak, after which point you change data-bak back to data.