# Dealing with snapshot corruption

**URL:** <https://kopia.discourse.group/t/dealing-with-snapshot-corruption/767>\
**Category:** Support\
**Created:** [November 24, 2021, 5:20pm UTC](https://kopia.discourse.group/t/dealing-with-snapshot-corruption/767 "2021-11-24T17:20:39Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![jkowalski](https://yyz2.discourse-cdn.com/free1/user_avatar/kopia.discourse.group/jkowalski/32/3_2.png) [@jkowalski](https://kopia.discourse.group/u/jkowalski)\
**Post date:** [November 25, 2021, 2:33am UTC](https://kopia.discourse.group/t/dealing-with-snapshot-corruption/767/2 "2021-11-25T02:33:45Z")

</div>

Currently there’s not a great way to recover from such corruption, other than migrating to a new repository.

You need to create second repository and use `kopia snapshot migrate`. To make sure you’re not mixing those up, always pass `--config-file`:

```auto
kopia --config-file /path/to/new.config repository create ...
kopia --config-file /path/to/new.config snapshot migrate --source-config /path/to/old.config
kopia --config-file /path/to/old.config repository disconnect

```

This will copy snapshot from a corrupted repository to a clean ones - any invalid files due to unreadable chunks will be treated the same way as if there were bad sectors/read errors on the original disk - they will be reported as errors and ignored, so you will end up with a clean repository that’s missing some files.

---

_[View the full topic](https://kopia.discourse.group/t/dealing-with-snapshot-corruption/767)._
