Send a complete zfs pool

Imagine, that you have a zfs pool with dozens of zfs datasets which you need to migrate to another box. “How do I accomplish that” is a reasonable question. Actually, that’s dead easy with zfs send/receive mechanism:

# zpool list zones
NAME    SIZE   USED  AVAIL    CAP  HEALTH  ALTROOT
zones  67.5G  30.5G  37.0G    45%  ONLINE  -

Firstly create a recursive snapshot and once it’s over you could send/receive the resulting data stream to another host:

# zfs snapshot -r zones@zones_snapshot
# zfs send -R zones@zones_snapshot | ssh user@host "zfs receive -Fd zones"

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.