I’m putting this here to help others but also so I can find how I cloned a zfs pool from one server to another at a later point in time (as in: in a few years).
I have three servers:
old is being backed up (using sanoid/syncoid) to
backup locally, plus an online backup destination.
old server is getting long in the tooth (coming up to running continuously 8 years soon), has a raidz2 6x6TB spinning (data/home) pool, and consumes quite a bit of power. I had to replace one of the disks inside it’s warranty period and I recently had to replace another of the disks as it started spitting UNCorrectable errors.
Local backups are pulled to
backup using my rpi pull backup HOWTO.
new server. raidz2 6x4TB SSD, more memory, faster CPU and overall half the power consumption. Nice.
Problem (at least for me):
I’d like to clone (for the lack of better words) the pool setup from
new so I can continue to have
backup pull snapshots as if nothing happened. This server is the server you have always looked at. You will proceed (Jedi-mind-trick/hand-wave)
All the documentation for ZFS and sanoid/syncoid describes things in more detail (far more, actually) that I really want.
zfs send and
zfs receive man pages are not your friends. The
syncoid man page/POD is better, but you need a couple of tries to get it right.
First, temporarily enable root ssh access on the
newserver. Step two is to use
syncoid to copy data over:
root@old:# syncoid --skip-parent --recursive --no-sync-snap --sshkey=/root/.ssh/$KEYFILE --sshcipher=aes128-ctr --compress=none tank root@new:tank
Then wait the appropriate amount of hours. The final step is to run a
zpool scrub to confirm that the pool on
new is in good shape before destroying the
I picked the
aes128-ctr cipher by testing the transfer performance of
scp -c $cipher new:file . between the
new servers in question. They are on a 10GbE LAN, so bandwidth is more expendable than CPU cycles.