2022-01-30 16:17:22 +01:00
|
|
|
## Sicherung
|
|
|
|
|
2023-01-10 12:08:32 +01:00
|
|
|
=== "docker compose (Plugin)"
|
|
|
|
|
|
|
|
``` bash
|
|
|
|
cd /pfad/zu/mailcow-dockerized
|
|
|
|
source mailcow.conf
|
|
|
|
DATE=$(date +"%Y%m%d_%H%M%S")
|
|
|
|
docker compose exec -T mysql-mailcow mysqldump --default-character-set=utf8mb4 -u${DBUSER} -p${DBPASS} ${DBNAME} > backup_${DBNAME}_${DATE}.sql
|
|
|
|
```
|
|
|
|
|
|
|
|
=== "docker-compose (Standalone)"
|
|
|
|
|
|
|
|
``` bash
|
|
|
|
cd /pfad/zu/mailcow-dockerized
|
|
|
|
source mailcow.conf
|
|
|
|
DATE=$(date +"%Y%m%d_%H%M%S")
|
|
|
|
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
|
|
|
|
|
2023-01-10 12:08:32 +01:00
|
|
|
!!! warning "Warnung"
|
|
|
|
=== "docker compose (Plugin)"
|
|
|
|
Sie sollten den SQL-Dump ohne `docker compose` umleiten, um Parsing-Fehler zu vermeiden.
|
2022-01-30 16:17:22 +01:00
|
|
|
|
2023-01-10 12:08:32 +01:00
|
|
|
=== "docker-compose (Standalone)"
|
|
|
|
|
|
|
|
Sie sollten den SQL-Dump ohne `docker-compose` umleiten, um Parsing-Fehler zu vermeiden.
|
|
|
|
|
|
|
|
``` bash
|
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
|
|
|
```
|