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 compression method for the new repository using
kopia policy --global --compression <compression-method>
and optionally set other compression settings - Migrate snapshots from the original repository using
kopia snapshot migrate --all --source-config <path-to-orig-repo-config>
- (Optional) Delete the original repository and move the newly created repository where the original repository was