Adding a second replication target, how to sync all previous snapshots?

Hello all,

New to TrueNAS, coming from a Synology world, may years overdue!

If I am replicating one source to a target (zfs snapshot replication), and wish to later on add and begin to replicate to a second target, is it possible to sync all the historical snapshots from the source to the second target to ‘catch it up’ to be equivalent to the first target?

Thanks for all your help!

You can sync everything that is still present on the source.

If you have a longer retention on the first target than on the source and the question is really if you can sync that - well, just sync manually from first target to second target once, then create your second replication task on the source. That will work.

3 Likes

Thank you so much for the insanely fast reply! Does that mean I can start by syncing the “oldest” snapshot on the source to the second target, then cycle through all the snapshots in order of age from oldest to newest, to catch up to the most recent, so the second target will be in line with the first target? (I am thinking I would script the commands using a LLM)

You just create a second replication task which will take care of all of that automtically just like with your first target.

Which commands?

Automatic replication and ajustable retention periods on both source and target are a builtin feature available in the UI.

“Where we are going we don’t need … ‘commands’.”

– Doc Emmet Brown

1 Like

Oh wow, I thought if I’m replicating from Source to Target 1, then say 6 months later add a Target2 to the mix and start replicating from Source to Target2, it will only sync the snapshots from the time the replication is configured to Target2, not all the historical snapshots on the Source.

In my mind I was imagining it as “a snapshot taken, send to target then set appropriate bit as sent, repeat for next snapshot”. Didn’t think setting a new target up would sync all previous snapshots available on the source!