To copy my restic repository snapshot. I expected the copy of the snapshot to have the same snapshot ID as the original, 410b18a2. However the snapshot ID is different. I thought restic copy copies the snapshot and so everything is the same including the state of the snapshot and snapshot ID.
I thought restic copy copies the snapshot and so everything is the same including the state of the snapshot and snapshot ID.
This is not quite what happens. A new snapshot is created in the destination repository, containing the data from the source snapshot; it gets a new snapshot ID. Someone more knowledgeable about the internals of restic could probably explain the technical reasons behind this. EDIT: Thinking about this some more, it’s probably because the new snapshot has new metadata, and the ID is the checksum of the snapshot.
As an aside, restic copy is smart enough to figure out which snapshots in the source repository correspond to which snapshots in the target repository if you run it again, so they won’t be copied over and over.