Reuse existing credentials during restore

Hi All,

I’m starting backup my data using duplicacy and B2 backend. I’m also planning to periodically “verify” my backups by, say, randomly downloading a few files from recent revisions to a temporary local workspace, compare their SHAs or MD5SUMs to my original local sources (from which it was uploaded in the first place). I intend to automate this process so that if there is a mismatch noted, I’ll be notified via email of some sorts…

For this to seamlessly work, I’m thinking the automated script would be work similar to this post: Restore to a different folder or computer . However, what I’d like is to not re-enter the password, B2 access keys, etc every time the automated script does its download. I could store these credentials in environmental variables too. But, I was wondering if there is a way to “reuse” my existing credentials from my existing source repository for this automated script.

Say, I have a source repo in a directory called “/path/to/source” and all the preferences, key ring etc have been stored in “/path/to/duplicacy-config” folder (so that the .duplicacy folders don’t mingle with the repo). If I intend to restore only some files to a different folder say “/path/to/backuptest”, I’m wondering if I can point duplicacy at the “/path/to/duplicacy-config” folder and get things to work? Can I merely make a copy of the “/path/to/duplicacy-config” folder and then re-use it? Any other steps I’m missing…?

This post also seems related to Restore has no option to pick destination, but I couldn’t tell if version 2.1.1 has the option to restore to a different folder (in my example, use “/path/to/duplicacy-config” but restore not to the usual repo, but a different repo folder…

Thanks!

Did you store credentials in the .duplicacy/preferences file? If so, can you just copy this file?

1 Like

@gchen, thanks for your reply (and the tool itself :smile:). I did see this topic: Passwords, credentials and environment variables where it’s mentioned that the keys and passwords are stored in plaintext in the .preferences file, and that it should be avoided.

Based on your suggestion, I tried a different thing. I copied over my entire .duplicacy folder (which includes the preferences, cache and the keyring files and I modified the preferences file so that the repository key now points to a different folder, and I tried running the restore command from the newly copied .duplicacy folder. It worked seamlessly. Hope this methodology is find. Anyone sees any problems with this?