gilbertchen / duplicacy

A new generation cloud backup tool
https://duplicacy.com
Other
5.16k stars 336 forks source link

How to restore from scratch? #431

Open ksalman opened 6 years ago

ksalman commented 6 years ago

Say I had initialized and done a backup of /data and then deleted the local directory. How do I restore this directory now? Do I need to have saved /data/.duplicacy prior to deleting /data? Looking at duplicacy --help, I don't see any way to list repositories and/or restore them. I tried the info option

$ duplicacy info b2://test
The storage is encrypted with a password

I have the password set in the environment variable.

leftytennis commented 6 years ago

duplicacy list can be used to show all of the snapshots in a repository and duplicacy list -files can be used to show the actual files in a snapshot.

ksalman commented 6 years ago

@jt70471 I might have not been clear. I can list the snapshots in the repository/directory. But what do I do if i have deleted the directory/repository from my local system and want to restore it? What is the process for that?

gilbertchen commented 6 years ago

This is explained in https://github.com/gilbertchen/duplicacy/wiki/Restore-to-a-different-folder-or-computer

ksalman commented 6 years ago

@gilbertchen Thanks for that link. I just tried to initialize a new repository (just to test the restore)

$ duplicacy init foo b2://test
Failed to download the configuration file from the storage: The storage is likely to have been initialized with a password before

How do I specify the password? duplicacy init has the -e option but that says

OPTIONS:
   -encrypt, -e                                 encrypt the storage with a password

It looks like that is for encrypting the storage, not for specifying the password for the already encrypted storage. The password is in the environment variable so I am not sure why it's not just using that.

I have these defined and exported in my environment

DUPLICACY_PASSWORD
DUPLICACY_B2_KEY
DUPLICACY_B2_ID
gilbertchen commented 6 years ago

The description for the -e option may be confusing, but you need to specify it when you're initializing a new repository with an existing storage.

ksalman commented 6 years ago

That doesn't seem to be working for me.

$ duplicacy init -e $DUPLICACY_PASSWORD foo b2://test
The init command requires 2 arguments.

NAME:
   duplicacy init - Initialize the storage if necessary and the current directory as the repository

USAGE:
   duplicacy init [command options] <snapshot id> <storage url>

OPTIONS:
   -encrypt, -e                                 encrypt the storage with a password
   -chunk-size, -c 4M                           the average size of chunks
   -max-chunk-size, -max 16M                    the maximum size of chunks (defaults to chunk-size * 4)
   -min-chunk-size, -min 1M                     the minimum size of chunks (defaults to chunk-size / 4)
   -pref-dir <preferences directory path>       Specify alternate location for .duplicacy preferences directory (absolute or relative to current directory)
TheBestPessimist commented 6 years ago

its duplicacy init -e foo b2://test, and only after that, at the prompt, you enter the password (by hand). you don't pass the password as argument after -e.

ksalman commented 6 years ago

@TheBestPessimist Oh I see, thanks. I didn't realize that it's not looking for the password after -e. I misinterpreted the options part.