Replication Tasks not copying the parent dataset

I am trying to setup replication tasks to backup date to another truenas server. It works, except for one small thing. It doesn’t copy over the root dataset.

Example:

tank
– dataset1
---- photos
---- documents
– dataset2

I select dataset1, but on the remote it just copies over photos and documents.

I was trying out another replication task where I select dataset1 and dataset2 and that copies over as I would expect, where it’s an exact duplicate.

Is there anyway to do the same thing when selecting only 1 dataset as the parent? I even tried to do Full Filesystem Replication.

As you can see it doesn’t include the 10-19-personal dataset at the root. If I were to select 0-9-reserved as well, it would include both of those as the root datasets, which is what I would expect to happen even with one selected.

This is when I select multiple datasets:


As you can see it creates the 2 parent datasets.

Are you wishing to “nest” the (source) dataset 10-19-personal under the (destination) dataset knas-backup?

From what your configuration shows, knas-backup on the destination is 10-19-personal from the source.


If you want to “nest” it, you need to manually type into the “Destination” text field:
backup/knas-backup/10-19-personal

Is it practical to start over again?

1 Like

Yeah, I can start over. I’m just testing right now.

If manually type it in, will it copy over the properties from the dataset as well? It’s just weird that when I select 2, it includes the root dataset as well.

I can probably run that scenario later and show you what I mean.

You’re only manually typing in where the target dataset will be. (In this case, the parent that is selected on the source side will now be “here”.)

Everything else will be the same, such as the dataset properties.

I get that, but would it just be a folder or an actual dataset. I updated the original post to show when I select 2 datasets. It’s a completely different behavior compared to selecting just 1, but it’s also the behavior I want. I want the original parent dataset to be created as I have certain properties created on that dataset that propagate down.

A dataset. ZFS replications don’t know or care about folders.


This is because the GUI is not showing you what it is actually going to do under the hood.

What makes things more confusing is that unlike doing a single command in the command-line, the GUI’s Replication Tasks does back-to-back commands, one after the other, and will dispatch multiple replications (such as when you select two source datasets), even though it appears as a single “task” in the GUI.

ahhh ok, im just waiting for this other one to finish to try it out. That makes sense.

Because when you select more than one source dataset, you’re actually creating multiple zfs send|recv with different source datasets, even though it appears as a single replication to the user when they look at the GUI.

Imagine you have a “main” pool and a “backup” pool.

Imagine that the backup pool is empty. No datasets, except for the mandatory root dataset (which has the same name as the pool).

Right now you have this:

Main Pool

main
main/media
main/media/tv
main/media/movies

Backup Pool

backup

Ignore the missing snapshot names, for the sake of illustration.

This command…
zfs send -R main/media | zfs recv backup

…will result in this:

backup
backup/tv
backup/movies

(This is what happens when you select a single source dataset in the GUI.)


These two commands…
zfs send -R main/media/tv | zfs recv backup/tv
zfs send -R main/media/movies | zfs recv backup/movies

…will result in this:

backup
backup/tv
backup/movies

However, the source dataset media will not transfer over. While the backup dataset will not be overwritten by the source’s media dataset.

(This is what happens when you select multiple source datasets in the GUI.)


This command…
zfs send -R main/media | zfs recv backup/media

…will result in this:

backup
backup/media
backup/media/tv
backup/media/movies

(This is what happens when you select a single source dataset in the GUI, and you manually type in the desired destination, which will be created on the backup pool.)

Yes, the first time the replication is run will create media on the destination, even if it didn’t originally exist.


Don’t be fooled by the GUI. You’re not selecting any “folders”. You don’t even need to select anything with your mouse. You can manually type in the desired destination in the text field with your keyboard.

1 Like

ooooooohhhhh, this makes so much more sense. Thank you for explaining what is going on under the hood. This makes a lot more sense to me know. Thank you! That is exactly what I am looking for.