# Change compression algorithm on half-full repository

**URL:** <https://kopia.discourse.group/t/change-compression-algorithm-on-half-full-repository/2402>\
**Category:** Support\
**Created:** [November 7, 2023, 10:00pm UTC](https://kopia.discourse.group/t/change-compression-algorithm-on-half-full-repository/2402 "2023-11-07T22:00:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Giorgio\_Frigo](https://yyz2.discourse-cdn.com/free1/user_avatar/kopia.discourse.group/giorgio_frigo/32/837_2.png) [@Giorgio\_Frigo](https://kopia.discourse.group/u/Giorgio_Frigo)\
**Post date:** [November 7, 2023, 10:00pm UTC](https://kopia.discourse.group/t/change-compression-algorithm-on-half-full-repository/2402/1 "2023-11-07T22:00:43Z")

</div>

I have a question about compression.

I have a repository compressed with S2, fast and performant.

But I need to make more space and I would like to set up pgzip compression.

What happens if I do it? I don’t want to cause problems.

Are the previous files converted to pgzip or only the new files that will be backed up?

Will I end up with a half S2 and half PGZIP repository or will everything be standardized with the new compression algorithm?

Thank you

---

<div class="post-metadata">

**Author:** ![dimejo](https://yyz2.discourse-cdn.com/free1/user_avatar/kopia.discourse.group/dimejo/32/287_2.png) [@dimejo](https://kopia.discourse.group/u/dimejo)\
**Post date:** [November 9, 2023, 8:04am UTC](https://kopia.discourse.group/t/change-compression-algorithm-on-half-full-repository/2402/2 "2023-11-09T08:04:19Z")

</div>

Old blobs are not automatically converted to the new compression algorithm. Only new blobs will be using the new algorithm. `kopia content stats` shows how much data is saved uncompressed or compressed with a certain algorithm.

This post explains how to recompress your data (with a new repository):

> [@Recompressing objects in repository](https://kopia.discourse.group/t/recompressing-objects-in-repository/1847/6):
>
> I got around to trying kopia snapshot migrate and I can confirm it can be used for this purpose – the migrated snapshots indeed honor policy settings of the target repository, including compression settings. To summarize, a repository can be recompressed including existing snapshots in the following way: Create a repository config file for the existing repository, e.g. by making a copy of \<kopia-config-dir\>/repository.config Create a new repository using kopia repository create Set the comp…

---

<div class="post-metadata">

**Author:** ![Giorgio\_Frigo](https://yyz2.discourse-cdn.com/free1/user_avatar/kopia.discourse.group/giorgio_frigo/32/837_2.png) [@Giorgio\_Frigo](https://kopia.discourse.group/u/Giorgio_Frigo)\
**Post date:** [November 9, 2023, 8:37am UTC](https://kopia.discourse.group/t/change-compression-algorithm-on-half-full-repository/2402/3 "2023-11-09T08:37:47Z")

</div>

Thank you for support Alex! @dimejo
