duplicati
duplicati copied to clipboard
Fix recovery tool empty file restore and other bugs
Closes #4884
- Fix missing block error message when restoring empty files, which were not restored
- Fix bug when restoring backup that only contains one file with recovery tool
- Fix path separator issues when recovering a Windows backup on Linux
- Fix one unnecessary level of directories in restore path
- Add unit tests for restore paths and add empty file to existing test case
Steps to reproduce (single file error)
- Create unencrypted local backup with only one source file (test.txt)
- Run recoverytool
index .in destination folder - Run recoverytool
restore . --targetfolder=restore
Current behavior
- Output:
Removing common prefix ...\source\test.txt\ - Error:
System.ArgumentOutOfRangeException
New behavior
- Output:
Removing common prefix ...\source\ - No error
Steps to reproduce (empty file error)
- Create unencrypted local backup (with at least two files) and one empty file
- Run recoverytool
index .in destination folder - Run recoverytool
restore . --targetfolder=restore
Current behavior
- Error:
System.Exception: Unable to locate block with hash: 47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU= - Empty files are not restored
New behavior
- No error
- Empty files are restored (without metadata like all files)
Steps to reproduce (unnecessary directory level)
- Create unencrypted local backup (with at least two files that are not empty) in folder
source - Run recoverytool
index .in destination folder - Run recoverytool
restore . --targetfolder=restore
Current behavior
- Files are restore to
restore\source -
restorecontains only the single foldersourcethat could be removed from the prefix
New behavior
- Files are restored to
restoredirectly
Steps to reproduce (directory separators)
- Requires Linux/macOS (Windows accepts slashes as separators)
- Copy test backup from Windows install, or create unencrypted Linux/macOS backup and replace paths in dlist.zip with Windows paths including backslashes
- Run recoverytool
index .in destination folder - Run recoverytool
restore . --targetfolder=restore
Current behavior
- Files are restored without a folder, instead they have the path including backslashes as a filename
New behavior
- Files are restored with the original folder structure