This morning, I was attempting to clean up my storage and ran a wrong command. Thankfully I stopped it before much damage was done, but the data is lost. Its important app databases/configs, and Im hoping to do anything I can to recover it.
Unfortunately, I also deleted my local backups in the mishap, meaning that all of my local ways to restore are gone. The only files left for me to possibly save this from are in my repository, but Kopia snapshot config for that folder was cleared this morning as well.
The data is up there, untethered to any snapshot in kopia, but Im curious if its at all possible to get it back before maintenance wipes it out for good. Will do anything at this point
I seemed to be able to “roll back” by manually removing the indexes written today. The files are still in recovery, so waiting to see if it really worked
When you delete snapshots in Kopia, it writes new index files (prefixed with x in the repository) to reflect the deletion. The underlying pack data (p-prefixed blobs) is still there. If a repository was working recently and maintenance has not run yet, it may be helpful to try to remove (or stash away) the most recently-written index files whose names start with x in the reverse timestamp order one by one until the issue is fixed. This will effectively roll back the repository writes to a prior state
How to do it:
-
List your remote blobs: kopia blob ls
-
Identify the x-prefixed index files with the most recent timestamps
-
Either move them aside or delete them (careful — work from newest backward)
-
Reconnect to the repository and check if kopia snapshot list --all shows your snapshots again
This essentially un-writes the snapshot deletion, as the manifest data is stored in those index blobs, so I deleted any index file created after the 6am run today, and was able to recover my appdata backup that was created yesterday. I had to enable dangerous commands in order to run the delete with this command:
kopia blob delete \
xindex1 \
xindex2 \
–dangerous-commands=enable