Copy snapshots between repositories without --copy-chunker-params

Hi,

I bought a new HDD and initialized a restic repository on it. Afterwards I copied several snapshots from another HDD to the new one, but I did not use --copy-chunker-params when initializing the new repository.

Can I “fix” this mistake somehow afterwards? E.g. by using rewrite on the copied snapshots?

Documentation is very clear about it:

Note that it is not possible to change the chunker parameters of an existing repository.

@kapitainsky thanks. My question goes more in the direction if it is possible to “rewrite/rebuild” the copied snapshots that they follow the current chunker parameters.

As of today only manually by restore and backup again. This is what “rewrite” would do anyway.

@kapitainsky thanks again (also for replying that fast)

Regarding rewrite: Are you sure that this would work, because the advandage would be that the timestap would be kept and not a “new” one would be generated.

Content timestamps will stay the same. Snapshot timestamp not. You can always use tagging to mark such snapshots and control later forget operations for example. All depends on your specific requirement.

Just made a small test with two test-repositories:

  • When using rewrite snapshot time stays the same (i.e. does not change)
  • rewrite needs to “exclude” something, otherwise the snapshot will stay unchanged
  • rewrite does not “restore and backup” again (as mentioned above by @kapitainsky), because then it would apply the chunker parameters of the current repository and deduplication would work, but this does not seem to be the case.

Seems like I need to find another solution that deduplication works after copying snapshots where I forgot to use --copy-chunker-params when initializing a new repository. Maybe copy again after init with using --copy-chunker-params

I meant “rewrite” command applying deduplication - which does not exist:) Not rewrite command used to remove files from existing snapshots.:slight_smile: Sorry - I should be more explicit.

Only way to achieve what you want today is to restore snapshot and backup it again. Which in terms of required workload is exactly what not existing “rewrite” command would do - it would have to download and upload again all snapshot data.

Given that you have local disk repository probably the easiest option is to start all process from scratch.