Page 1 of 1
"deleted" snapshots, can I restore them?
Posted: 10. Oct 2017, 23:56
by zinzara
So, I was trying to move my snapshots folder to a secondary drive when I had active VMs (I later realized this is not possible). I tried to change the folder in the settings of the VM and it complained saying I need to delete the snapshots first. So, I made copies of the snapshots and then went through and deleted the snapshots in the snapshots tab. Then I set the new folder (which contained the copies of the snapshots) thinking it would just see the snapshots there and everything would work. It didn't. And that's where I did some searching online and found that you can't do that with active VMs...
Now comes the fun part. Is there any way I can restore it back to the way it was? I haven't started the VM since I started this process so no changes have been made (that I'm aware of?). However, I'm thinking I'm pretty much *&^@#$ due to the fact it would basically be what I was trying to do in the first place. I already tried just putting the files back but my guess is when I "deleted" the snapshots, it changed a lot of things, maybe even the VDI disk itself...It's not a HUGE deal seeing as how this is a pretty new install. No loss of data, just have to reinstall/reconfigure. Thankfully I only did this on one VM as a test case. Any suggestions/fixes? Thanks.
Re: "deleted" snapshots, can I restore them?
Posted: 11. Oct 2017, 10:54
by mpack
Why do you want the snapshots back? If you used the UI to delete the snapshots then no data has been lost, all you lost was the ability to revert to those markers.
Re: "deleted" snapshots, can I restore them?
Posted: 11. Oct 2017, 10:57
by socratis
You have a couple of options:
- Merge all the snapshots with your main VDI using CloneVDI. You dump snapshots and the main VDI in one directory, select the last snapshot and CloneVDI will merge everything into a nice single VDI, which you can build your VM around.
- Try to recreate the structure with the snapshots manually. Tedious (seriously), quite error prone, but you get your snapshot chain. If possible that is, it depends how much "damage" you've done.
Which one will it be?
| Edit: The solutions proposed above do not apply. I misread the original post and didn't realize that the merge had already occurred from within VirtualBox. Hence, neither the manual reconstruction, nor the CloneVDI merging of the snapshots apply. The merge from within VirtualBox is an irreversible process. Sorry about the misunderstanding... |
Re: "deleted" snapshots, can I restore them?
Posted: 11. Oct 2017, 12:47
by mpack
Uh, I would not attempt in this instance to merge snapshots using CloneVDI. If the OPs description is accurate then they were already merged using VirtualBox.
p.s. For future reference, the correct way to move a VM to another location is described here:
Howto: Move a VM.
Re: "deleted" snapshots, can I restore them?
Posted: 11. Oct 2017, 13:08
by socratis
zinzara wrote:and then went through and deleted the snapshots in the snapshots tab.
zinzara wrote:it changed a lot of things, maybe even the VDI disk itself
Don, I think you're right, the OP merged the whole thing from within VirtualBox and now they want to go back to the old status quo. This is a "no, can't do" situation...
Re: "deleted" snapshots, can I restore them?
Posted: 11. Oct 2017, 19:00
by ChipMcK
Restore the BackUp of VM before doing the merging.
Re: "deleted" snapshots, can I restore them?
Posted: 11. Oct 2017, 21:18
by zinzara
The reason I'm trying to get the snapshots back is when I create VMs, I take snapshots at multiple points during setup/configuration so that if something gets jacked up along the way, I have each step I can refer back to including a completely clean initial install. In that case, I can go back to a clean install and start over without having to actually reinstall the guest OS. During the delete snapshots, I think it may have merged everything unfortunately, but I'm not sure. Also, I did not want to move everything to a new location. Only the snapshots. I want the original .vdi to be in the original location.
socratis wrote:You have a couple of options:
- Merge all the snapshots with your main VDI using CloneVDI. You dump snapshots and the main VDI in one directory, select the last snapshot and CloneVDI will merge everything into a nice single VDI, which you can build your VM around.
- Try to recreate the structure with the snapshots manually. Tedious (seriously), quite error prone, but you get your snapshot chain. If possible that is, it depends how much "damage" you've done.
Which one will it be?
I would like to have the original snapshots back not merged. I have them saved off separately from before I did the deletion from within VBox. I tried moving them back to the original "snapshots" folder but VBox didn't see them. After you mentioned manually recreating the structure, I was able to find this article which appears to be the "fix":
https://www.treshna.com/rebuilding-virt ... snapshots/ As you mentioned, it is tedious and error prone so I will not be doing this but it is nice to know for future reference and anyone who stumbles across this post. Thank you for your assistance.
Re: "deleted" snapshots, can I restore them?
Posted: 11. Oct 2017, 21:50
by ChipMcK
zinzara wrote:
I have them saved off separately from before I did the deletion from within VBox.
that is not a
BackUp of the VM.
to make valid
backUp of a VM, see
Moving a VM.
Re: "deleted" snapshots, can I restore them?
Posted: 11. Oct 2017, 23:27
by socratis
zinzara wrote:I would like to have the original snapshots back not merged.
Well, the thing is that I misread your original post, and mpack corrected me. What you did (merge the snapshots) is an irreversible process. There's no manual recontruction or anything close to that. You can't undo that action unfortunately. Neither can you use CloneVDI, because you already merged the snapshots from within VirtualBox. So, my post is pretty much invalid. I'll edit to scratch out the parts that do not apply.
PS. That link you gave is as useless as they come. There is no chance that this thing will give you back your hard drive. At best you could
potentially recover
some files that were not modified in between snapshots. The guy makes it sound like "Hey, there's a snapshot missing, no big deal". Well, I'm sorry to say that they don't have the slightest idea how snapshots work.