Error trying to restore to a different folder from CLI

I have the web version installed on Windows 10, configured 1 folder to be backed up into B2 cloud storage. This folder holds 1 text file right now. I’m testing to see how things work before moving forward. Right now I’m trying to restore something from this backup using the CLI, but it’s not working. I want to restore from B2 to a different folder than it was backed up from.

I’m doing this in a batch file. I have setup my environment variables in the batch file (password, B2 ID, B2 KEY, etc) and other commands work fine (list, check, history all work fine).

I’m trying to restore to folder M:\Temp

So my batch file changes to the M:\Temp folder, then runs the INIT command as the forum posts say I should do, but I get an error:

download URL is: https://f000.backblazeb2.com
Failed to download the configuration file from the storage: The storage is likely to have been initialized with a password before

Then I try the RESTORE command and get another error:

ERROR PREFERENCE_OPEN Failed to read the preference file from repository M:\Temp: open M:\Temp/.duplicacy/preferences: The system cannot find the file specified.

I did a restore from the web gui into the m:\temp folder and it worked fine. Then I deleted everything inside m:\temp and tried in the CLI but get these errors.

Strange thing is these are the errors I am currently getting from the CLI, after doing a restore once from the web gui. Before doing it in the web gui I was getting different errors, but I can’t remember what those errors said. I think it was something about the preferences not allowing me to set the repository?

I’m trying to establish my procedures to restore everything (or just one or more large folders) from the CLI instead of using the web gui. How can I make this work? Thanks.

You just need to run the INIT command under M:\Temp with the -e option. This option should be used when the storage is encrypted.

Thank you, this worked.

I noticed I have to manually enter the encryption key/password at the command prompt. It doesn’t pull it from the environment variable like the other commands will do. That’s unfortunate since my key/password is a very long string. But at least it works. :white_check_mark:

Thanks again!