Testing restore to new vps - fail

So, I have all working fine - good work :smile:
But, I wanted to test, if I know how to export backups from old vps and restore it to new one.
Installed miab to new vps, over scp copied all backups and seckey.txt.
Issued command:
export PASSPHRASE=$(cat /home/nisko/batest/seckey.txt) -E duplicity restore file:///home/nisko/batest /home/user-data/

…and:
bash: export: -E': not a valid identifier bash: export: file:///home/nisko/batest’: not a valid identifier
bash: export: `/home/user-data/': not a valid identifier

I have not used “sudo” because I worked as root user, but tried as not root, but no change.

So, if my box have some troubles, I dont know how to restore to new one :frowning:
Whot is done wrong? Thanks…

Continuing the discussion from Restoring-Directory already exists:

The -E flag is for the sudo command, if you dont use it then you also dont have to write the flag. If you are logged in as root then just do

export PASSPHRASE=$(cat /home/nisko/batest/seckey.txt) && duplicity restore file:///home/nisko/batest /home/user-data/

PS: Note that these are actually two commands!

1 Like

Restore destination directory /home/user-data already exists.
Will not overwrite.

someone previously commented, that he added force, but I dont know where to place it?
(thank You :slight_smile: )

You put the force like this:
duplicity restore --force file:///home/nisko/batest /home/user-data

2 Likes

Synchronizing remote metadata to local cache…
Copying duplicity-full-signatures.20160424T010003Z.sigtar.gpg to local cache.
Copying duplicity-full.20160424T010003Z.manifest.gpg to local cache.
Copying duplicity-inc.20160424T010003Z.to.20160425T010002Z.manifest.gpg to local cache.
Copying duplicity-inc.20160425T010002Z.to.20160426T010002Z.manifest.gpg to local cache.
Copying duplicity-inc.20160426T010002Z.to.20160427T010003Z.manifest.gpg to local cache.
Copying duplicity-inc.20160427T010003Z.to.20160427T095024Z.manifest.gpg to local cache.
Copying duplicity-new-signatures.20160424T010003Z.to.20160425T010002Z.sigtar.gpg to local cache.
Copying duplicity-new-signatures.20160425T010002Z.to.20160426T010002Z.sigtar.gpg to local cache.
Copying duplicity-new-signatures.20160426T010002Z.to.20160427T010003Z.sigtar.gpg to local cache.
Copying duplicity-new-signatures.20160427T010003Z.to.20160427T095024Z.sigtar.gpg to local cache.
Last full backup date: Sun Apr 24 03:00:03 2016
Error ‘[Errno 17] File exists’ processing ssl/ssl_certificate.pem

I dnot know, some error msg.

Ok, it seems, that all data is restored. I tried to login with backup admin credemals and logged in sucessfully. E-mail msgs are there.
So, I thinking, that returned error 17 with certificate may be, because I used new domain name? I dont know.
Very Thank You to all, you helped me to restore. Im going to backup that restore command for later use :smiley:

1 Like

I believe it’s simply not replacing the file that contains the private key associated with your SSL certificate.

1 Like

I tried to restore to new vps, yes you v60fan is right. But next problem is, that nginx was not started and it couldnt, because of certs misconfig.
So, I re-initialized my vps to fresh ubuntu and moved my email boxes over imap…
But, previous box used box.domain.biz and new box.domain2.eu .
So, may be, that domain change is problem with backup restore to new vps.

1 Like