"deleted" snapshots, can I restore them?

This is for discussing general topics about how to use VirtualBox.
Post Reply
zinzara
Posts: 3
Joined: 8. Feb 2012, 08:15

"deleted" snapshots, can I restore them?

Post 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.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: "deleted" snapshots, can I restore them?

Post 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.
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: "deleted" snapshots, can I restore them?

Post by socratis »

You have a couple of options:
  1. 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.
  2. 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... 
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: "deleted" snapshots, can I restore them?

Post 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.
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: "deleted" snapshots, can I restore them?

Post 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...
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
ChipMcK
Volunteer
Posts: 1095
Joined: 20. May 2009, 02:17
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Windows, OSX
Location: U S of A

Re: "deleted" snapshots, can I restore them?

Post by ChipMcK »

Restore the BackUp of VM before doing the merging.
zinzara
Posts: 3
Joined: 8. Feb 2012, 08:15

Re: "deleted" snapshots, can I restore them?

Post 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:
  1. 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.
  2. 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.
ChipMcK
Volunteer
Posts: 1095
Joined: 20. May 2009, 02:17
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Windows, OSX
Location: U S of A

Re: "deleted" snapshots, can I restore them?

Post 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.
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: "deleted" snapshots, can I restore them?

Post 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.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Post Reply