docs
Some checks failed
Container Publish / on-success-skip (push) Has been skipped
Container Publish / build-image (arm64, 10.11) (push) Successful in 1m34s
Container Publish / build-image (arm64, 10.6) (push) Successful in 1m23s
Container Publish / build-image (arm64, 11.4) (push) Successful in 1m35s
Container Publish / build-image (arm64, 11.8) (push) Successful in 1m32s
Container Publish / build-image (amd64, 10.11) (push) Successful in 2m48s
Container Publish / build-image (amd64, 10.6) (push) Successful in 3m17s
Container Publish / build-image (amd64, 11.4) (push) Successful in 3m16s
Container Publish / build-image (amd64, 11.8) (push) Successful in 2m46s
Container Publish / update docker manifest (10.11) (push) Successful in 10s
Container Publish / update docker manifest (10.6) (push) Successful in 8s
Container Publish / update docker manifest (11.4) (push) Successful in 9s
Container Publish / update docker manifest (11.8) (push) Successful in 9s
Vulnerability Scan / Daily Vulnerability Scan (amd64, 10.11) (push) Failing after 7s
Vulnerability Scan / Daily Vulnerability Scan (arm64, 10.11) (push) Failing after 6s
Vulnerability Scan / Daily Vulnerability Scan (amd64, 10.6) (push) Failing after 6s
Vulnerability Scan / Daily Vulnerability Scan (arm64, 10.6) (push) Failing after 6s
Vulnerability Scan / Daily Vulnerability Scan (amd64, 11.8) (push) Failing after 6s
Vulnerability Scan / Daily Vulnerability Scan (arm64, 11.4) (push) Failing after 6s
Vulnerability Scan / Daily Vulnerability Scan (arm64, 11.8) (push) Failing after 6s
Vulnerability Scan / Daily Vulnerability Scan (amd64, 11.4) (push) Failing after 47s

This commit is contained in:
2025-06-19 07:18:19 +02:00
parent 4a784721dd
commit be9f7133a8

View File

@@ -79,7 +79,7 @@ docker-compose up -d
Create the database: Create the database:
```bash ```bash
docker exec my-container sh -c 'echo "create database aWordpressDatabase;" | exec mysql -uroot -p"$MYSQL_ROOT_PASSWORD"' docker-compose exec backup-slave sh -c 'echo "create database aWordpressDatabase;" | exec mysql -uroot -p"$MYSQL_ROOT_PASSWORD"'
``` ```
### Freeze the master ### Freeze the master
@@ -109,7 +109,7 @@ The classic way is preferred when you have a big database because it locks the d
Now, we need to import the backup from the master, so as we started the slave as readwrite, we can now do this on the slave: Now, we need to import the backup from the master, so as we started the slave as readwrite, we can now do this on the slave:
```bash ```bash
docker exec my-container sh -c 'mysqldump -C --lock-tables=false --quick -u repluser -h master.host --password="aRandomPassword" aWordpressDatabase | mysql -u root -p"$MYSQL_ROOT_PASSWORD" aWordpressDatabase' docker-compose exec backup-slave sh -c 'mysqldump -C --lock-tables=false --quick -u repluser -h master.host --password="aRandomPassword" aWordpressDatabase | mysql -u root -p"$MYSQL_ROOT_PASSWORD" aWordpressDatabase'
``` ```
Replace **my-container**, **repluser**, **master.host**, **aRandomPassword**, **aWordpressDatabase** with the correct values. Replace **my-container**, **repluser**, **master.host**, **aRandomPassword**, **aWordpressDatabase** with the correct values.
@@ -141,10 +141,10 @@ On the slave, copy the dump file in the running container, like this:
docker cp thedump.sql.gz my-container:/thedump.sql.gz docker cp thedump.sql.gz my-container:/thedump.sql.gz
``` ```
Then we import it: Then we import it:
```bash ```bash
docker exec my-container sh -c 'zcat /thedump.sql.gz | mysql -u root -p"$MYSQL_ROOT_PASSWORD" aWordpressDatabase' docker-compose exec backup-slave sh -c 'zcat /thedump.sql.gz | mysql -u root -p"$MYSQL_ROOT_PASSWORD" aWordpressDatabase'
docker exec my-container sh -c 'rm /thedump.sql.gz' docker exec my-container sh -c 'rm /thedump.sql.gz'
``` ```