Restore from a backup

What would be the proper way to restore a backup?

Let’s assume I have copied all of the backup files (eg. from s3) to the local directory /tmp, and the secret_key.txt is also in that directory.

  1. disable the services
  2. <command to restore from /tmp to /home/user-data>
  3. re-enable the services

What would #2 look like?


The restore process should be modeled after management/

  • If this is on a machine with Mail-in-a-Box already running, perhaps force a backup before proceeding.
  • If this is on a fresh machine, backup dependencies (openssl, duplicity, etc.?) need to be installed and STORAGE_ROOT and STORAGE_USER need to be determined. Perhaps this means the restore should be baked into setup/
  • Call openssl to decrypt files to a new directory.
  • Run duplicity to restore the unencrypted files to $STORAGE_ROOT. Duplicity needs to be told to use some other temp path as a cache and that temp dir needs to be purged at the end. The user will also need to be asked which timestamp to restore.
  • Run setup/ to ensure things are in working order.

I just moved mail-in-a-box last night to another server and wrote out steps to steps here
Hope to help.