Recompressing objects in repository

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:

  1. Create a repository config file for the existing repository, e.g. by making a copy of <kopia-config-dir>/repository.config
  2. Create a new repository using kopia repository create
  3. Set the compression method for the new repository using kopia policy --global --compression <compression-method> and optionally set other compression settings
  4. Migrate snapshots from the original repository using kopia snapshot migrate --all --source-config <path-to-orig-repo-config>
  5. (Optional) Delete the original repository and move the newly created repository where the original repository was
3 Likes