Deja Dup and Duplicity failing to restore in version associated with Ubuntu 18.04
I had backups of my home using Deja Dup. It asked for a password and I gave it one. Now I used that backup to transfer my home directory so that I can update from Ubuntu 18.04 to Ubuntu 20.04. I backed up seriously but I neglected to try restoring. Big mistake on my part. I tried to restore using Deja Dup, but the restore is failing because it refuses to acknowledge my password. My issue is I need some files from the home directory and now I can't get them. They are in a backup that so far is inaccessible and on a disk that I have reformatted (although did not write data to).
I took that disk and reformatted that old home partition for Ubuntu 20.04, now used for the /opt directory. I formatted it in the install of Ubuntu 20.04. Aside from that the data may still be there.
I took that disk to a tech repair place and they say they could not find any data since I reformatted. Is that true? I still have the disk and now I removed it so I still could look for my old home directory. If you have any suggestions on how to recover the original home directory that would help. I know exactly where the old home partition was on the disk.
Now Deja Dup won't restore the back up. It says the pass phrase is incorrect. I stubbornly tried retyping and modifying but to no avail.
For Deja Dup, I followed this wiki https://wiki.gnome.org/Apps/DejaDup/PassphraseProblems2019 and it summarizes exactly my case. I think it is possibly the same bug as: https://bugs.launchpad.net/duplicity/+bug/918489
When I run a duplicity restore command and type in the correct password I get this error.
GPGError: GPG Failed, see log below: ===== Begin GnuPG log ===== gpg: AES encrypted data gpg: encrypted with 1 passphrase gpg: decryption failed: Bad session key ===== End GnuPG log =====
That website gives a command that checks the password for every gpg file in the directory. Essentially that directory has a full back up from 9/05 and then incremental ones from later in September through October 12. When I check the passphrase on each file almost all of them say the password is correct! I thought I am home free. However the files from October 5 to October 8 say password is incorrect. I know that the password is correct for nearly all the backups but is incorrect for only one of them.
To get this to work I used this command:
for i in /$BACKUPFOLDER/*; do echo $i; if gpg --passphrase=$PASSPHRASE --batch --pinentry-mode=loopback --decrypt $i >/dev/null 2>/dev/null; then echo -e "^ \033[0;32mcorrect passphrase\033[0m"; else echo -e "^ \033[0;31mwrong passphrase\033[0m"; fi; done
from that website. On most files I get correct passphrase but on those from October 5 to 8 I get "wrong passphrase".
That has rendered Deja Dup incapable of restoring the back up. I tried even for days prior to the change in password. That did not work. I tried guessing the passphrase for those days varying my passphrase considering possible typos. That also did not lead to the mistaken passphrase.
Here I used this command using both a goodfile and the good passphrase and a bad file with passphrase guesses: if gpg --passphrase=$PASSPHRASE --batch --pinentry-mode=loopback --decrypt $BACKUPFILE >/dev/null 2>/dev/null; then echo -e "\033[0;32mpassphrase worked\033[0m"; else echo -e "\033[0;31mpassphrase did not work\033[0m"; fi
Next I am trying to decrypt individual vol files and piec together my home directory.
I am following this website.
https://wiki.gnome.org/Apps/DejaDup/Help/Restore/WorstCase#Restoring_by_Hand So far I am able to decrypt some volumes using gpg and the correct passphrase.
Now I would like to say how disturbing this is. It is very likely if you do alot of backups that you will type in the wrong passphrase once. If you do on Ubuntu 18.04 you will have this error and your backups won't be easily restorable. Even though it is reported it is a big error because it leads to important data loss for many users. I did updates all the time for Ubuntu 18.04 but somehow deja dup did not get updated to a bug free version. This is a really bad error. Users should know of this bug for that version before backing up!
To my knowledge I did not have a cache of passwords stored anywhere in the OS. I never used the passphrase manager.
Next I would like to know if there is any way to recover this data. Is it best to try to restore individual files or try to recover the reformatted partition?
back up with deja dup in ubuntu 18.04. type in passphrase.
back up again later. This time type in a different pass phrase.
back up later with the original pass phrase.
(go to the About menu item, where you'll either see a System tab or a Debug Information button, and copy the text copy here)