#1079742 simplesnap: Please document recommended restore procedure

#1079742#5
Date:
2024-08-27 06:20:08 UTC
From:
To:
The manual page of simplesnap(1) contain a great quick start recipe for
making backups.  Is there a similar nice description on how to restore
everything as well?  Perhaps such recipe could be written in the manual
page too.  After all, no-one really want toa mek backup, we want the
ability to do restores.  This is of course related but not the same
thing. :)

#1079742#10
Date:
2024-08-29 14:47:31 UTC
From:
To:
Hi Petter,

Well this might sound a bit weird, but there really isn't one :-)

simplesnap is sort of a low-level tool for moving ZFS snapshots around
in a routine way.  How someone moves them back is probably circumstance-
and system-dependent.  For instance, if a person needs just a few files
from a previous backup, they will probably tar or rsync from the
snapshot on the system holding it.  On the other hand, if they've lost
an entire drive, they may do a zfs send -R over the network to restore
everything.  Neither of those really has a need for the simplesnap-style
automation.

Does that make sense?

- John

#1079742#15
Date:
2024-09-02 15:54:52 UTC
From:
To:
[John Goerzen]

Well, given that the recipe to do the backup was so prominent and
helpful in the documentation, I hoped a similar good recpie would be
available for restore.

In any case, I solved it like this from the backup host side:

  for s in $(zfs list -t snapshot|awk '/hostset/ {print $1}'); do \
    echo $s; zfs send $s | \
      ssh -i /root/.ssh/id_rsa_simplesnap host.local \
      zfs receive myzpool/restore/$(echo $s | cut -d/ -f4-|cut -d@ -f1); \
  done

Once this was done, I used 'zfs rename' to change the
.../restore/... names to their old names.

(I had to do a complete backup/restore because I added a spare raidz
disk the wrong way, and zfs would not allow me to fix it without
backup/restore.)