2022-01-30 16:17:22 +01:00
|
|
|
## Backup
|
|
|
|
|
|
|
|
```
|
|
|
|
cd /path/to/mailcow-dockerized
|
|
|
|
source mailcow.conf
|
|
|
|
DATE=$(date +"%Y%m%d_%H%M%S")
|
2022-06-02 14:32:36 +02:00
|
|
|
docker compose exec -T mysql-mailcow mysqldump --default-character-set=utf8mb4 -u${DBUSER} -p${DBPASS} ${DBNAME} > backup_${DBNAME}_${DATE}.sql
|
2022-01-30 16:17:22 +01:00
|
|
|
```
|
|
|
|
|
|
|
|
## Restore
|
|
|
|
|
|
|
|
!!! warning
|
2022-06-02 14:32:36 +02:00
|
|
|
You should redirect the SQL dump without `docker compose` to prevent parsing errors.
|
2022-01-30 16:17:22 +01:00
|
|
|
|
|
|
|
```
|
|
|
|
cd /path/to/mailcow-dockerized
|
|
|
|
source mailcow.conf
|
2022-06-02 14:32:36 +02:00
|
|
|
docker exec -i $(docker compose ps -q mysql-mailcow) mysql -u${DBUSER} -p${DBPASS} ${DBNAME} < backup_file.sql
|
2022-01-30 16:17:22 +01:00
|
|
|
```
|