diff --git a/docs/b_n_r_backup.md b/docs/b_n_r_backup.md new file mode 100644 index 000000000..fedb83f9d --- /dev/null +++ b/docs/b_n_r_backup.md @@ -0,0 +1,29 @@ +### Backup + +You can use the provided script `helper-scripts/backup_and_restore.sh` to backup mailcow automatically. + +Please do not copy this script to another location. + +To run a backup, write "backup" as first parameter and either one or more components to backup as following parameters. +You can also use "all" as second parameter to backup all components. + +``` +# Syntax: +# ./helper-scripts/backup_and_restore.sh backup (vmail|redis|rspamd|postfix|mysql|all) + +# Backup all +./helper-scripts/backup_and_restore.sh backup all + +# Backup vmail and mysql data +./helper-scripts/backup_and_restore.sh vmail mysql + +``` + +The script will ask you for a backup location. Inside of this location it will create folders in the format "mailcow_DATE". +You should not rename those folders to not break the restore process. + +To run a backup unattended, define BACKUP_LOCATION as environment variable before starting the script: + +``` +BACKUP_LOCATION=/opt/backup /opt/mailcow-dockerized/helper-scripts/backup_and_restore.sh backup all +``` diff --git a/docs/b_n_r_restore.md b/docs/b_n_r_restore.md new file mode 100644 index 000000000..0aae41810 --- /dev/null +++ b/docs/b_n_r_restore.md @@ -0,0 +1,15 @@ +### Restore + +Please do not copy this script to another location. + +To run a restore, write "restore" as first parameter. + + +``` +# Syntax: +# ./helper-scripts/backup_and_restore.sh restore + +``` + +The script will ask you for a backup location containing the mailcow_DATE folders. + diff --git a/mkdocs.yml b/mkdocs.yml index 98952fe1e..e279aeec7 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -40,6 +40,13 @@ pages: - 'Reset Passwords': 'debug-reset_pw.md' - 'Remove Persistent Data': 'debug-rm_volumes.md' - 'Common Problems': 'debug-common_problems.md' +- 'Backup & Restore': + - 'Helper script': + - 'Backup': 'b_n_r_backup.md' + - 'Restore': 'b_n_r_restore.md' + - 'Manually': + - 'Maildir': 'u_e-backup_restore-maildir.md' + - 'MySQL': 'u_e-backup_restore-mysql.md' - 'Usage & Examples': - 'mailcow UI': - 'Configuration': 'u_e-mailcow_ui-config.md' @@ -61,9 +68,6 @@ pages: - 'Customize Dockerfiles': 'u_e-docker-cust_dockerfiles.md' - 'Docker Compose Bash Completion': 'u_e-docker-dc_bash_compl.md' - 'Why unbound?': 'u_e-why_unbound.md' - - 'Backup & Restore': - - 'Maildir': 'u_e-backup_restore-maildir.md' - - 'MySQL': 'u_e-backup_restore-mysql.md' - 'Autodiscover / Autoconfig': 'u_e-autodiscover_config.md' - 'Redirect HTTP to HTTPS': 'u_e-80_to_443.md' - 'Adjust Service Configurations': 'u_e-change_config.md'