what is the recommended way to migrate from an encrypted dataset to am unencrypted one?
You have to be extra careful using the command-line.
If this encrypted dataset has
no children, you can replicate it into a
new unencrypted dataset by first creating a new snapshot, and then sending that snapshot (while excluding the
encryption property.)
First switch to the root user if you are not already root (not sure how SCALE handles this):
Create the migration snapshot:
Code:
zfs snap mypool/cryptdata@migrate-`date +%Y-%m-%d_%H-%M`
Send the snapshot to a new dataset (which does not exist yet.) The new dataset will be
created from this replication.
Code:
zfs send -v -L -e -c mypool/cryptdata@migrate-2023-07-03_14-38 | zfs recv -v -o encryption=off mypool/plaindata
You will now have a new unencrypted dataset named "plaindata" which will be as up-to-date as the moment you created the new "migrate" snapshot.
A quick breakdown:
- mypool = the name of your pool (also the name of your root dataset)
- cryptdata = the name of the currently encrypted dataset
- plaindata = the name of the new unencrypted dataset (which doesn't exist until you run the send/recv)
- @migrate-`date +%Y-%m-%d_%H-%M` = the new snapshot name which will be timestamped (with the "zfs snap" command)
- @migrate-2023-07-03_14-38 = an example of how the actual snapshot name will appear
- -v = be verbose
- -L = large blocks support
- -e = more efficient embedded stream
- -c = more efficient compressed stream (don't "decompress" records that are already compressed)
- -o = override a property on the receiving side (in this case, disable encryption)
If everything looks good, you can now destroy the old dataset.
However, keep in mind that you will not have any snapshots sent over, except for the most recent "migrate" snapshot.
The above method will not send any "nested children" living underneath your source dataset.
The above method requires that you (temporarily) have enough free space for both datasets, since nothing is deleted automatically.
EDIT: I should add that it's recommended to do the above in a new "tmux" session, so that you can close the window without interrupting the send/recv process. It's also advisable to use a "resume token" in case the process does interrupt or abort.