# "Undelete" snapshots

**URL:** <https://kopia.discourse.group/t/undelete-snapshots/3361>\
**Category:** Support\
**Created:** [October 25, 2024, 10:46pm UTC](https://kopia.discourse.group/t/undelete-snapshots/3361 "2024-10-25T22:46:16Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![hristanelo](https://avatars.discourse-cdn.com/v4/letter/h/50afbb/32.png) [@hristanelo](https://kopia.discourse.group/u/hristanelo)\
**Post date:** [October 25, 2024, 10:46pm UTC](https://kopia.discourse.group/t/undelete-snapshots/3361/1 "2024-10-25T22:46:16Z")

</div>

It seems that even if a repo with `immutability/object locking` is used, one can still delete snapshots in `kopia`(at least according to my tests, shouldn’t that be impossible?).  
One can then use `--point-in-time` connect option to access the data, but can these existing snapshots be easily recovered as if they were not deleted at all and just continue the incremental chain, apart from restoring first and the re-uploading them, that is assuming the source data is intact?

---

<div class="post-metadata">

**Author:** ![kapitainsky](https://yyz2.discourse-cdn.com/free1/user_avatar/kopia.discourse.group/kapitainsky/32/535_2.png) [@kapitainsky](https://kopia.discourse.group/u/kapitainsky)\
**Post date:** [October 26, 2024, 4:23am UTC](https://kopia.discourse.group/t/undelete-snapshots/3361/2 "2024-10-26T04:23:08Z")

</div>

> [@hristanelo](#):
>
> One can then use `--point-in-time` connect option to access the data, but can these existing snapshots be easily recovered as if they were not deleted at all and just continue the incremental chain, apart from restoring first and the re-uploading them, that is assuming the source data is intact?

Both data and repository can be recovered using `--point-in-time` option. To restore snapshots you can use `kopia repository sync-to` and sync snapshots to another repo.

---

<div class="post-metadata">

**Author:** ![hristanelo](https://avatars.discourse-cdn.com/v4/letter/h/50afbb/32.png) [@hristanelo](https://kopia.discourse.group/u/hristanelo)\
**Post date:** [October 28, 2024, 2:23am UTC](https://kopia.discourse.group/t/undelete-snapshots/3361/3 "2024-10-28T02:23:41Z")

</div>

Right, this is certainly an option - `kopia repository sync-to`, but it’s still a (potentially expensive) data copy IIUC. My point was to recover the repo “in-place”, like rollback the state of the repo right before the deletion.

---

<div class="post-metadata">

**Author:** ![kapitainsky](https://yyz2.discourse-cdn.com/free1/user_avatar/kopia.discourse.group/kapitainsky/32/535_2.png) [@kapitainsky](https://kopia.discourse.group/u/kapitainsky)\
**Post date:** [October 28, 2024, 8:29am UTC](https://kopia.discourse.group/t/undelete-snapshots/3361/4 "2024-10-28T08:29:52Z")

</div>

> [@hristanelo](#):
>
> My point was to recover the repo “in-place”, like rollback the state of the repo right before the deletion.

It is not possible using kopia but I think you could achieve it using other tools. For example you could use rclone with `--s3-version-at` flag to access past bucket state and sync it to the current one. All operation can be done server side so you can avoid any egress charges. Or use the same logic and cloud specific tools like aws cli.

---

<div class="post-metadata">

**Author:** ![hristanelo](https://avatars.discourse-cdn.com/v4/letter/h/50afbb/32.png) [@hristanelo](https://kopia.discourse.group/u/hristanelo)\
**Post date:** [October 28, 2024, 1:10pm UTC](https://kopia.discourse.group/t/undelete-snapshots/3361/5 "2024-10-28T13:10:35Z")

</div>

> It is not possible using kopia but I think you could achieve it using other tools - that’s what I wasn’t sure about, thanks for confirming. I will test it on the could side as you suggested.

That said, I still think it makes sense for `kopia` to be able to reject any snapshot deletions on an immutable repo.

---

<div class="post-metadata">

**Author:** ![kapitainsky](https://yyz2.discourse-cdn.com/free1/user_avatar/kopia.discourse.group/kapitainsky/32/535_2.png) [@kapitainsky](https://kopia.discourse.group/u/kapitainsky)\
**Post date:** [October 28, 2024, 2:23pm UTC](https://kopia.discourse.group/t/undelete-snapshots/3361/6 "2024-10-28T14:23:01Z")

</div>

> [@hristanelo](#):
>
> That said, I still think it makes sense for `kopia` to be able to reject any snapshot deletions on an immutable repo.

You can run your repo in append only mode. But this is something entirely different than object lock. And yes you can use both at the same time if it suits your requirement.
