Ensure your external hard drive is connected, powered and mounted. If this is the case you should be able to view to files in Nautilus, the File Manager.
Then you should find the location of the folder you backed your files up to. Navigate there using Nautilus, such that you are in the folder with all the compressed backup files. Now press ctrl+L to bring up the current directory in text form. Now copy that directory.
Open the terminal (ctrl+alt+T) and type:
duplicity list-current-files "file://PasteLocationHere" > backuplist.txt
(to paste into a terminal right click and select paste or use ctrl+shift+V)
So for example it might look like:
duplicity list-current-files "file:///media/HD1TB/backup folder" > backuplist.txt
Now what we can do is open the file this just generated called backuplist.txt
(by running the command gedit backuplist.txt
or nano backuplist.txt
) and this will tell us which directories we have backed up on our hard drive. Now what we can do is look down that list for a directory we want to restore and copy the directory. For example the file might look like this:
Local and Remote metadata are synchronized, no sync needed.
Last full backup date: Sun Jan 5 14:25:20 2014
Wed Feb 19 21:21:58 2014 .
Sat Jan 4 17:15:24 2014 home
Mon Mar 3 13:56:33 2014 home/jamie
Thu Feb 27 14:41:17 2014 home/jamie/Documents
Thu Feb 27 14:41:17 2014 home/jamie/Documents/important_form.odt
Thu Feb 27 14:41:04 2014 home/jamie/Documents/untitled1.txt
Thu Feb 13 08:29:22 2014 home/jamie/Desktop/Timetable.odt
Wed Feb 12 16:52:27 2014 home/jamie/Desktop/Timetable.pdf
Thu Feb 27 10:00:24 2014 home/jamie/test.py
And now we can choose one of those folders (say home/jamie/Documents
) to restore. To do this, copy the directory you want to restore and run the command:
duplicity --file-to-restore "home/jamie/Documents/" "file:///media/HD1TB/backup folder" "/home/jamie/restoreFolder" --no-encryption
(restoreFolder should not already exist before running the command). You should replace jamie
with your user name (it's written in the terminal, something like: jamie@Cooper:~$
where it's userName@computerName:~$
Now if you open up the folder in your home directory called: restoreFolder
you should see all the files from the folder you wanted to restore.
The old method of restoring via right-click in Nautilus should work. The only time that option is not available in the context menu is when you are in a folder that is not included in the current backup settings. On your fresh install, make sure you have configured the backup exactly like on the old install.
A little technical background: Nautilus doesn't check what backups currently exist on the system. In fact, doing so would take a long time and cannot be done everytime you right-click on a folder. It only checks which folders are scheduled for backup and shows the option whenever you are in such a folder.
(Also, it seems like it doesn't check for exclusion filters – even in excluded folders, the restore option is available if the parent folder is included. Deja-dup won't restore anything though if you actually click it.)
If you still don't succeed on your machine for whatever reason, you can use this method instead:
deja-dup --restore [File1 File2 ...]
will restore individual files if you know their names.
deja-dup --restore-missing [Directory]
will restore the files that have been deleted from the given directory.
Note that both of these commands will bring up the Deja-Dup Restore GUI, which will also allow you to specify the backup source. You don't need to do the whole task on the command line.
Best Answer
Copying the solution from this guide with my modifications:
Open a Terminal and navigate to the directory containing your backups. This folder contains all of your files archived into many .gz files. Mine was in a folder called
multivol_snapshot
. Unpack all the archives with the following command:for t in duplicity-full.[yournumbershere].*.difftar.gz; do tar xf $t; done
This might take awhile. I had 138GB of data which took five hours to untar.
Running this will give you your files and folders back in the correct structure with one caveat: All of the files are split into smaller pieces. You can join these files back manually easily by running the following command:
cat * > examplefile.txt
However, if you have thousands of files doing this could take a very long time. David Huss wrote a Python script called duplicity_joiner.py to make this easier. Download it here.
To run it, you need python and tk. Install this by running:
sudo apt-get install python-dev sudo apt-get install python-tk
Using this script you can select the folder where to restore your files, with one caveat: This script doesn't maintain the folder structure. So, if you have many folders and files with the same name there is a possibility that they will be overwritten.
I have rewritten the script to address this. It will preserve the folder structure but can result in very long folder paths. Download it here.