I’m planning to use Restic with multiple repositories, and I want to ensure efficient deduplication when copying snapshots between them.
From what I understand, each repository created with restic init gets its own randomly generated chunker parameters. This means that independently initialized repositories may chunk data differently, which reduces deduplication efficiency when using restic copy.
The documentation mentions the --copy-chunker-params option, which allows initializing a new repository using the chunker parameters from an existing one.
My question is:
Is it considered good practice to create one “template” repository and then initialize all future repositories using:
restic init --copy-chunker-params <template-repo>
so that all repositories share identical chunker parameters?
Are there any drawbacks or risks to this approach? It seems like the intended use case for --copy-chunker-params, but I’d like to confirm with the community and maintainers before adopting this pattern.
I would not say it is “good practice” as I don’t hear about people doing that (creating a template repository).
Is it wrong? I don’t think so. Is it needed? I don’t think so.
I’d say you create the repository you want to back up to as the primary one, and if you ever want additional repositories that copies data from that first repository, you just use the option you mentioned to make sure they have the same chunker parameters at that point.
If you need more repositories with the same chunker parameters you can just do the same thing again – I simply don’t see what the point of that empty template repository would be.
Disclaimer: I don’t use the copy command/feature myself.
Let’s assume I have a repo_1 with some snapshots already inside, and now I need to copy some snapshots to repo_2. But repo_2 already exists and was not initialized with --copy-chunker-params, so in that case I will not get the full benefits of deduplication.
Using a template repository to initialize each new repo would ensure that all of them share the same chunker parameters, which should give me the best possible deduplication - at least that is my understanding.
So if this approach is not wrong and does not introduce any additional issues, it might actually make my life easier in my situation.