I currently have datasets for lxd and kvm VMs on one zfs pool that I'd like to migrate to another. Both the source and destination pools use zfs's encryption, though they have different keys. My end goal is to:
First, I create a dataset to host the backups on the destination pool
It looks like for the first send, I should use
Here is attempting to send the oldest snapshot on the lxc dataset:
It looks like
While I haven't tried it yet, it does seem likely I could create a brand new recursive snapshot and send it. But, that would omit all of my current snapshots.
Suggestions? I tried with syncoid (as it's what I used to move the dataset to this pool), but it also had errors.
- Replicate all existing snapshots, mostly created with
zfs-auto-snapshot
. - Preserve any cloned datasets (lxc starts new containers with a clone from an "images" dataset)
- Be able to do incremental sends until I'm ready to cut lxc and kvm over to the new pool.
- Preserve encryption - while it would be nice to re-encrypt the data at the destination so I'm only dealing with one set of keys, I can always work around that later if I have to send the raw data stream.
First, I create a dataset to host the backups on the destination pool
rpool
: $ zfs create rpool/backup
It looks like for the first send, I should use
--replicate
to send all descendent filesystems, snapshots and so on. I'd need to use --raw
because the source is encrypted.Here is attempting to send the oldest snapshot on the lxc dataset:
Code:
# zfs send --replicate --raw spool/lxc@syncoid_spool_2019-09-24:20:36:30 | zfs recv rpool/backup
cannot send spool/lxc@syncoid_spool_2019-09-24:20:36:30 recursively: snapshot spool/lxc/custom@syncoid_spool_2019-09-24:20:36:30 does not exist
warning: cannot send 'spool/lxc@syncoid_spool_2019-09-24:20:36:30': backup failed
cannot receive: failed to read from stream
--replicate
is expecting that identical snapshot names exist on each child dataset, which isn't the case. Perhaps -I
will fix it?
Code:
# zfs send --replicate --raw -I spool/lxc@syncoid_spool_2019-09-24:20:36:30 spool/lxc@zfs-auto-snap_frequent-2020-12-29-1845 | zfs recv rpool/backup
cannot receive incremental stream: most recent snapshot of rpool/backup does not
match incremental source
Suggestions? I tried with syncoid (as it's what I used to move the dataset to this pool), but it also had errors.