Copying a file-based backup between file systems

What invariants do I need to preserve in order to copy a file-based backup between two directories? e.g. to move between a local disk and a network disk

My thought so far is that I need to copy the snapshot directory first, then the KV ranges, then the logs, each in lexicographical order. I’m not sure if this is correct, though.

Ideally this would also work for copying a continuous backup, not just a one-time backup.

1 Like

The safe copy order (as you suspected) is

  • snapshots/
  • kvranges/
  • logs/
  • It is best to omit properties/.

Ordering of files copied within each of these folders does not matter.

You should then run
fdbbackup describe --deep
to scan the logs, regenerate accurate properties/ files (which will overwrite any included copies), and report the restorability of the backup copy.

Side note, backup files are immutable and are renamed into place after all data has been flushed, so there is no risk of copying a partial file that the backup tools would actually use.

Could this approach work reliably for zfs snapshots? They are on-disk instant across the filesystem.

I’m not sure exactly what you are asking. If you take a ZFS snapshot and then read it, the file contents are not changing so you can copy the data elsewhere in any order. The resulting restorability of the backup will be what you see from fdbbackup describe at the time of the snapshot, which won’t change if the folder contents does not change.