Best way to replicate entire pool to external hard drive

Hi,

I have one pool (tank) with multiple datasets, each with multiple children.

I have an external hdd dock connected to the TrueNAS server via usb3. Works well and I can access it like an internal drive to the server.

I want to create a full backup of tank including absolutely all data, snapshots, everything. I want a complete replica so I can restore the Truenas system in the case of disaster (a backup).

I will run the replication task manually - connect a drive, import the pool, run the replication task.

I want it to mirror the snapshots completely, so as
snapshots are deleted on Tank according to retention policies I want them to be removed from the external drive when running the replication. As new snapshots are added to Tank, I want the replication to mirror these across.

I can’t seem to achieve this.

I have tried selecting Tank as the source and the ā€˜recursive’ option and it indeed replicates all the data and snap shots. But the next time I run it, it does not clean up any deleted snapshots and the snapshot number on the external drive just grows and is no longer aligned with Tank.

I have tried using the ā€˜full replication’ option, but then the ā€˜recursive’ option is not available any more. I can then only select the child datasets of tank, which means all the auto snapshots of app and system data don’t seem to then replicate (which are located at Tank/app etc) as it throws an error if I select both child and parent datasets, ie. you can’t select both as data overlaps I am guessing?

What is the easiest way in this setup to keep a full copy of my Truenas data as a backup (absolutely everything) that remains a full mirror of the original pool, so I can recover everything in its entirety?

I must be missing something here.

BTW, I have overlapping snapshots set up for each of my data sets, where I have set it to recursively snapshot child datasets as well as the parent. I have also set retention periods for each. I have set the replication option of ā€˜Same as Source’ for retention period.

How do I mirror my Truenas hard drive to an external drive using the gui, preferably in an incremental way to save time and data transferred (changes only). I mean could dd the disk but seems dumb given power of zfs.

Any help much appreciated!

When i set up the local replication task, these are the settings i use:

  1. Tick ā€œrecursiveā€ = on
  2. Tick ā€œinclude dataset propertiesā€ = on
  3. ā€œDestination dataset read only policyā€ = set
  4. ā€œSnapshot retention policyā€ = ā€œsame as sourceā€

If this is your regular backup I’d also tick ā€œsave pending snapshotsā€ so the external destination can always be brought up to date.

1 Like

Thanks very much for the advice, I am playing with your suggested settings now.

I am finding that when I select the pool (Tank) and use ā€˜recursive’ it says 1 or 1 snapshots will be replicated. If I select the pool and also each of the next level down child datasets (this children have children but I am not selecting those), it gives me a much higher number of snapshots which will be replicated. Does selecting just the pool not drill down to the entire hierarchy of datasets even when ā€˜recursive’ is selected? It looks like you also need to select each of the top level child datasets to get recursive to work properly?

Do you use naming schema or regular expressions? If I use naming schema and don’t specify any schemas in ā€˜also include…’ I don’t get many snapshots replicated. If I add all the naming schemas to cover all snapshots, I get more but still only about half of those on the system. If I use regular expressions and .* I get 526 of 526 snapshots selected (which is much better!), but the system actually has 600 snapshots on it. I don’t know why it is not pulling everything!

It is all quite confusing - I just want a complete mirror image of the TrueNAS pool sent to an external disk.

Thanks for any further help.

I do not select the whole pool. Instead, I tick off the individual top-level datasets that I want replicated. Selecting a whole pool didn’t work for me.

I use the regular automatic naming that the TrueNAS develops for snapshots.

I would consider selecting the tickbox for a complete replication from scratch until you get the result you were looking for.

Thanks for that advice. Selecting the pool, with recursive, seemed to fail create my Datasets, but selecting all the Datasets did.

It was annoying that they all go a non-existent user’s ID, because WTF annoyingly, User IDs can no longer be specified at user creation or later, e.g. via shell commands, like in normal Linux/FreeBSD. So, I’ll have to waste time redoing all the Dataset permissions! What were Ix thinking?