1 8.0 Restore overview
Asif Bacchus edited this page 1 year ago

Restoring Backups

Restoring mailcow backups made by the backup script in this git repo is very much like doing a migration between servers. The notable exception is that the SQL database is restored from a dump file instead of straight-copied. The majority of these instructions will discuss a semi-automated restore using the new restore.sh script. If you want to do a fully manual restore, please refer to page 8.3.1.


First off, please remember to run everything as root! This will allow borg to restore files with proper permissions, ensure that docker doesn’t run into any problems and generally make your life easier.

The basic restore process is as follows:

  1. Download (‘extract’) the borg backup archive you want to restore from your remote repository to a local directory.

  2. Basic first-install of mailcow:

    1. Download mailcow git repo
    2. Run `generate.sh` to create configuration, CA list and snake-oil certificates
  3. Copy configuration files from restored backup to mailcow directory (i.e. /opt/mailcow-dockerized):

    • mailcow.conf
    • customization files (usually in data/conf/…)
    • certificates
    • etc.
  4. Start mailcow normally once to generate default configurations and volumes.

  5. Browse to mailcow admin panel and/or SOGo (front page) to verify everything is working with the defaults and the install is working before data restore.

  6. Run restore.sh script to restore data.

If this overview is enough for you to figure things out, then you can get started. Remember, you can run the restore script with the --help parameter for a quick overview on how to use it:

./restore.sh --help

If you need a little more guidance, the following pages will go through each step.