I have an existing ZFS pool with a few years’ worth of snapshots. I am building out a new pool and am about 80% convinced that I will be going with Rockstor this time around. However, I would love to retain my historical snapshots. Is there a way to migrate snapshots to btrfs?
My guess is that there is not an existing tool that just does this, but I wonder if the necessary hooks are there to do it manually (or rather, by script). I am thinking something along the lines of:
On old server (FreeNAS), mount a read-only copy of snapshot k.
On new server (Rockstor), perform an rsync from snapshot k on the old server to local.
Perform a snapshot on Rockstor (and ideally set that snapshot’s timestamp to match snapshot k from FreeNAS).
Repeat for snapshot k+1.
Does that make sense? Has anyone thought about tackling this?
Currently for aught I know there’s not a zfs-btrfs snapshots migrating tool, so if you just need to migrate your data right way is rsync plus an initial snapshot.
If instead you want to migrate all snapshots (does this make sense to replicate all old snapshots?), I’m not sure about that, but probably it’ll require a long time
For most of my media etc., I can get by with the just the data, but I have a couple volumes with documents, work stuff, photos, and financial information for which I never expire old monthly snapshots. My intent is to keep them forever. The bulk of my data (the media) I really just want to protect against single-device-failure and bit-rot, but the data with historical snapshots is my “mission-critical, non-reproducible” data; currently those snapshots are backed-up off-site with ZFS send-receive.
If I stay within the ZFS ecosystem, I can send-receive to new pools and machines when I upgrade, retaining those snapshots. If I switch to btrfs, I’d really like a way to get those historical snapshots into btrfs snapshots. Otherwise I have to leave my old pool of disks intact and can’t re-use them in Rockstor.
Does what I want to do at least sound possible manually? It would take approximately 3.61 billion years to do by hand, but anything that can be done manually can ultimately be scripted
OK, so it sounds like this is possible in principal, with some caveats.
There’s no way to poke the snapshot timestamp in btrfs after the fact, like you can do with files using touch? One workaround would be to add an empty placeholder file at the root of the migrated volume and, after rsync from the old ZFS snapshot to btrfs, set the file name to the ZFS snapshot’s timestamp. Are you able to e.g. “find file matching pattern in snapshots” with btrfs?
Another alternative would be to take those critical data sets with historical snapshots and do a permanent archive, either on a couple of off-site drives or Glacier or something; then if I want to go back further than the transition to Rockstor, I pull up the archival snapshots. That is less elegant, but it works.
On the fly answer (time to go home, escaping from office ) : not sure about touch, but a btrfs/zfs snapshot is not just a “filename” or a file atime mtime etc etc, it’ s a little more complex (metadata etc etc).
Obviously with some coding you can define your snapshot name (so you can match with the old zfs): you’re right and it is so easy I didn’t think about this xD
Yes I know, I’m using touch as a reference. As in, " is to btrfs snapshots as touch is to file atime, mtime, etc.".
My suspicion is that the root node for snapshots are immutable, thus is not possible. I may check the btrfs mailing list too, since this is pretty low-level in the filesystem itself and not really a Rockstor-specific thing.
I’m almost sure you can try the “tricky way” of rsync from a snapshot, snap on btrfs, rsync etc etc - note: depending on the number of snapshots you want to reproduce and total files size it can be a long and hard way, also with a script, more because of rsync rather than snapshots.