This is inspired largely by the new (/ returning) feature of OneDrive in Windows 10 Fall Creator's Update, which downloads files on-demand.
A side effect of that change is that the OneDrive folder (and subfolders of it) are marked as reparse points, even though they are not technically standard symlinks.
With this change, a new extension method IsSymlink is added for ISnapshotService and ISystemIO, which checks both the file attributes (for reparse point) and the symlink target path (if null, the path is not treated as a symlink).
All places that previously checked only the file attributes have been updated to use either this method (or at least the same logic, in the case of the core BackupHandler file check).
One side effect of this change is that '--symlink-policy=store' no longer ignores empty symlinks - they are now treated as regular files.
If there are empty symlinks, they will now be backed up as if they were regular files, but I don't know what the conditions are that create symlinks like that, so this might not effect anything in practice.
The AlphaVSS library now returns path from the listfiles/listfolders without the UNC prefix, so the code re-adds this to ensure the mapping from snapshot path to logical path is maintained.
Finished the feature to merge all VHD's before backing up. It now
collects information of the VM and merges the VHD's. We still need to
edit the XML to start from the base VHD and remove the Snapshottree.
Tried to stay clear of existing code but I eventually changed this to be
a List instead of an array. It's much more flexible. There really is no
performance gain with Arrays unless when we know that data is fixed
length and we want to micro-optimise.
Removed lot's of comments since all documentation can come here now.
Note: HyperV vss-writer; are already implicitly included in the
vss-writers vss-writer will disable all other vss-writers.
Implemented a feature to merge all VHD's in one. We could present this
as an option the the end-user.
It would also make up for a cleaner backup.
The XML still needs to be edited after the merge so that the config will
point to the parent VHD. Also the snapshots should be removed, these can
still be viewed in the Hyper-V Manager.
Wrote a function to load a XML file. We always copy the XML to the
tempfolder since it might be used by another process when we try to load
the file.
The other function will retrieve the associated active VHD of the
configuration.
The next step would be to copy certain configurations settings from the
backup XML to implement in the previously created Hyper-V machine.
Wrote a class and edited the Windowssnapshot to retrieve VM files on a
local Hyper. These will be added to the sourcepath. Duplicati takes care
of the rest.