2022-01-30 16:17:22 +01:00
|
|
|
## Sicherung
|
|
|
|
|
|
|
|
```
|
|
|
|
cd /pfad/zu/mailcow-dockerized
|
2022-01-30 16:20:34 +01:00
|
|
|
source mailcow.conf
|
2022-06-27 19:14:02 +02:00
|
|
|
DATE=$(date +"%Y%m%d_%H%M%S")
|
2022-08-31 14:45:46 +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
|
|
|
```
|
|
|
|
|
|
|
|
## Wiederherstellen
|
|
|
|
|
|
|
|
!!! warning
|
2022-08-31 14:45:46 +02:00
|
|
|
Sie sollten den SQL-Dump ohne `docker compose` umleiten, um Parsing-Fehler zu vermeiden.
|
2022-01-30 16:17:22 +01:00
|
|
|
|
|
|
|
```
|
|
|
|
cd /pfad/zu/mailcow-dockerized
|
2022-01-30 16:20:34 +01:00
|
|
|
source mailcow.conf
|
2022-08-31 14:45:46 +02:00
|
|
|
docker exec -i $(docker compose ps -q mysql-mailcow) mysql -u${DBUSER} -p${DBPASS} ${DBNAME} < backup_file.sql
|
2022-01-30 16:20:34 +01:00
|
|
|
```
|