Skip to content

feat: dump VPS snapshots with shopware-cli project dump - #31

Merged
ROBJkE merged 1 commit into
mainfrom
cursor/shopware-cli-dump-c3ee
Sep 13, 2026
Merged

ROBJkE merged 1 commit into
mainfrom
cursor/shopware-cli-dump-c3ee

Conversation

@ROBJkE

@ROBJkE ROBJkE commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

Replace compose-exec mysqldump/mariadb-dump in deploy/sync-runtime.sh (and therefore deploy/backup-runtime.sh snapshots) with shopware-cli project dump.

Production Shopware app images do not ship shopware-cli. Dumps run a one-shot container from the pinned official image, attached to the Compose network so hostname mysql resolves, with the shop root mounted for .env / .shopware-project.yml.

Dump invocation

Pin: ghcr.io/shopware/shopware-cli:0.18.4 (SYNC_SHOPWARE_CLI_IMAGE to override)

docker run --rm --network ${COMPOSE_PROJECT_NAME}_default \
  -v <shop-root>:<shop-root>:ro -v <snapshot-dir>:<snapshot-dir> -w <shop-root> \
  -e HOME=/tmp -e SHOPWARE_CLI_NO_UPDATE_NOTIFICATION=true \
  ghcr.io/shopware/shopware-cli:0.18.4 \
  --no-update-hint project dump \
  --skip-lock-tables --quick --clean --compression=gzip \
  --output <snapshot-dir>/db.sql.gz \
  --host mysql --port 3306 --username <MYSQL_USER> --database <MYSQL_DATABASE>

(--password is passed as a separate argv and is not logged.)

Flag / env Default
--skip-lock-tables always
--quick on (SYNC_DUMP_QUICK=0 opts out)
--clean on (SYNC_DUMP_CLEAN=0 opts out)
--anonymize off (SYNC_DUMP_ANONYMIZE=1 opts in)
--compression=gzip --output …/db.sql.gz snapshot path sync already expects

Pull/run failure fails closed with docker pull guidance. No silent mysqldump fallback. Escape hatch: SYNC_DUMP_ENGINE=mysqldump.

Unchanged

Docs / tests

sync-runtime.md, backup-runtime.md, deploy/README.md, sync.env.example, backup.env.example, post-install.txt, plus tests/sync-dump.test.sh.

Open in Web Open in Cursor 

Replace compose-exec mysqldump/mariadb-dump in sync/backup snapshots
with a one-shot ghcr.io/shopware/shopware-cli:0.18.4 container on the
Compose network (hostname mysql). Production web images do not ship
the CLI. Defaults: --skip-lock-tables --quick --clean --compression=gzip
--output db.sql.gz. Anonymize stays off. Fail closed on pull errors;
SYNC_DUMP_ENGINE=mysqldump is an explicit escape hatch. Restore is still
the MySQL/MariaDB client. Sales-channel rewrite path is unchanged.

Co-authored-by: ROBJkE <ROBJkE@users.noreply.github.com>
@ROBJkE
ROBJkE marked this pull request as ready for review September 13, 2026 07:42
@ROBJkE
ROBJkE merged commit b4efe14 into main Sep 13, 2026
@ROBJkE
ROBJkE deleted the cursor/shopware-cli-dump-c3ee branch September 13, 2026 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants