One minute
Duplicity: Selective restoring
The Problem
A couple of days ago, my laptop’s second HD (500GB WD) went rogue (once again). The issues:
- File corruption when accessing stored files
- System wouldn’t boot with drive connected (Ubuntu 13.04)
- All my work files were on the failing drive
Fortunately, I had:
- A 32GB SSD boot partition on the motherboard
- A full system backup on an external 3TB drive
The Challenge
The backup presented its own problems:
- Hundreds of GBs in size
- Only 32GB SSD available for restore
- Attempts to restore to backup drive itself failed
- Original folder structure gone, preventing GUI restore
The Solution: Selective File Restoration
After some research, here’s how to selectively restore files from a Duplicity backup:
1. List Backup Contents
duplicity list-current-files --no-encryption file:///[path_to_backup_folder] > ~/list.txt
Note: The file:///
prefix is required - use full path to backup folder
2. Create Restore Directory
mkdir [PATH_AND_FILENAME_FOR_RESTORED_FILE]
3. Restore Selected Files
Find your files in list.txt
(created in step 1), then:
duplicity restore --no-encryption --file-to-restore [FILE_FROM_LIST] \
file:///[LOCATION_OF_BACKUP] [RESTORE_PATH]
Important Notes
- Different procedure required for encrypted backups
- Check the Duplicity Reference
for encryption options Always verify restored files integrity Consider keeping critical files on more reliable storage
~