Operator path is fyrst-cli only. Install fyrst-cli on each VPS. The Flex
overlay in fyrst-dev/recipes
(fyrst/shopware-cd/1.0/root/deploy/) no longer ships the six deploy/*.sh
wrappers or a dispatcher. CI and cron call fyrst-cli shopware … — not
bash ./deploy/vps-release.sh or sync-runtime.sh snapshot.
Overlay script names in the map are historical. Overlay verbs
(snapshot / restore / sync, backup / restore) are retired.
Dump is shopware-cli project dump only. fyrst-cli does not dump, wrap
dump, or shell out to shopware-cli. There is no deploy/lib/sync-dump.sh.
Delegated tools:
| Concern | Owner |
|---|---|
| DB dump | shopware-cli project dump only. fyrst-cli does not dump, wrap dump, or shell out to shopware-cli. |
| DB import | fyrst-cli shopware db import (MySQL/MariaDB client). shopware-cli has no import. |
| VPS release | fyrst-cli shopware deploy release (docker compose with deploy/compose.yaml + compose.prod.yaml + compose.vps.yaml) |
| VPS rollback | fyrst-cli shopware deploy rollback (same compose files; IMAGE_TAG from .previous-tag) |
| Opt-in URL rewrite after restore | bin/console sales-channel:update:domain <host> via compose web (host from APP_URL; scheme, path, and port omitted) |
Historical overlay column = removed Flex deploy/*.sh names. Do not invoke
those scripts. Use the CLI column.
| Historical overlay (removed) | CLI | Nested verbs | Flags | Status |
|---|---|---|---|---|
deploy/init-env.sh |
fyrst-cli shopware env init |
init |
--shop-id, --env, --image, --dry-run |
implemented |
deploy/vps-release.sh |
fyrst-cli shopware deploy release |
release |
--dry-run, --skip-pull, --allow-no-deploy-health |
implemented |
deploy/vps-rollback.sh |
fyrst-cli shopware deploy rollback |
rollback |
--dry-run, --skip-pull, --allow-no-deploy-health |
implemented |
restore_db_* (sync-runtime) |
fyrst-cli shopware db import |
import |
--file, --dry-run, --allow-live |
implemented |
deploy/sync-runtime.sh snapshot |
fyrst-cli shopware sync capture |
capture |
--from, --data, --snapshot-dir, --dry-run, --skip-db, --skip-volumes |
volumes implemented (bind-mount trees → --snapshot-dir/data/<item>/; named-volume tar fallback). Not a dump command: --data db exits 2 and tells operators to run shopware-cli project dump |
deploy/sync-runtime.sh restore |
fyrst-cli shopware sync apply |
apply |
same flags | implemented: DB via same import module; bind-mount volumes from data/<item>/ or volumes/<item>.tar.gz; stop/start web/worker/scheduler; rewrite from APP_URL via compose web; live refuse unless SHOPWARE_ALLOW_LIVE_RESTORE=1; rewrite skipped on live |
deploy/sync-runtime.sh sync |
fyrst-cli shopware sync pull |
pull |
same flags | implemented (pull orchestration): rsync remote bind-mounts; DB imports an already-present dump (does not dump). Live refuse unless SHOPWARE_ALLOW_LIVE_RESTORE=1 |
deploy/sync-runtime-local.sh |
fyrst-cli shopware sync local |
local |
--from, --data, --remote-data-root, --delete, --dry-run |
implemented (VPS → local project-dev rsync; never DB; never SHOPWARE_DATA_ROOT; --data all refused) |
deploy/backup-runtime.sh backup |
fyrst-cli shopware backup create |
create |
--data, --dry-run |
implemented (volumes + operator db.sql.gz; not a dump wrap; live allowed) |
deploy/backup-runtime.sh prune |
fyrst-cli shopware backup prune |
prune |
--data (ignored; stamp-based), --dry-run |
implemented (retention under BACKUP_TARGET; not a dump) |
deploy/backup-runtime.sh restore |
fyrst-cli shopware backup recover |
recover |
--data, --dry-run, --artifact (aliases --stamp, --from), --i-understand-this-restores-this-host |
implemented (fetch artifact; inner apply = sync apply module; no dump) |
Hard cut (old clap names removed): init-env → env init; top-level release/rollback → deploy {release\|rollback}; sync snapshot → sync capture; sync restore → sync apply; sync sync / sync-local / backup backup / backup restore → sync pull / sync local / backup create / backup recover. See ADR-0002.
shopware env, shopware deploy, shopware sync, shopware backup, and
shopware db with no verb require a subcommand (clap prints help, exit 2).
Refuse a live consumer unless the gate below is set. One live-restore flag
for apply, pull, import, and backup recover (also in shopware --help).
sync = between environments / workdir. backup = off-host disaster recovery.
| Command | Gate |
|---|---|
db import |
--allow-live or SHOPWARE_ALLOW_LIVE_RESTORE=1 |
sync apply |
SHOPWARE_ALLOW_LIVE_RESTORE=1 only |
sync pull |
SHOPWARE_ALLOW_LIVE_RESTORE=1 only |
backup recover |
confirm flag (--i-understand-this-restores-this-host or BACKUP_CONFIRM_RESTORE=1) and SHOPWARE_ALLOW_LIVE_RESTORE=1 when SHOPWARE_DEPLOY_ENV=live |
deploy release / deploy rollback |
post-deploy health probe required (DEPLOY_HEALTH_URL or APP_URL). Ops escape: --allow-no-deploy-health or ALLOW_NO_DEPLOY_HEALTH=1 |
URL rewrite after apply calls Shopware sales-channel:update:domain with
the host from APP_URL (scheme and path stripped; port is not passed) and
is skipped on live (never applied). Staging / playground / dev need no
extra live flag for backup recover (still need confirmation).
One loader for every shopware verb. Process env is the base, then later files win except identity / process-win keys (a non-empty process value still owns those):
.env.env.localif present (laptop SSH / extras).env.prodif present (VPS)
Never deploy/sync.env or deploy/backup.env. Leftover SYNC_* /
BACKUP_SSH_* / BACKUP_ALLOW_* / SYNC_APP_URL fail when the replacement
is unset (no silent aliases). deploy/*.env stays gitignored so leftover
operator files are not committed; stop documenting them.
Data root: {SHOPWARE_DATA_BASE}/{SHOPWARE_SHOP_ID}/{SHOPWARE_DEPLOY_ENV}
(SHOPWARE_DATA_BASE default /var/lib/shopware/data). Optional override:
SHOPWARE_DATA_ROOT. SSH: SHOPWARE_SSH_HOST (defaults to the --from
alias), SHOPWARE_SSH_USER, SHOPWARE_SSH_KEY. Port is always 22. Remote
live data: SHOPWARE_REMOTE_DATA_ROOT or {data_base}/{shop_id}/live.
Rewrite: host from APP_URL (sales-channel:update:domain). CI VPS_* secrets stay secrets — they are not shop
.env.
fyrst-cli shopware env init [--shop-id SLUG] [--env live|staging|playground|dev] [--image REPO] [--dry-run]
fyrst-cli shopware deploy release [--dry-run] [--skip-pull] [--allow-no-deploy-health]
Resolves shop root (COMPOSE_DIR or walk from cwd), loads .env then
.env.local then .env.prod (never deploy/*.env). Process-env IMAGE /
IMAGE_TAG (and other VPS knobs) win when non-empty — CI tags beat .env
IMAGE_TAG=latest. Requires IMAGE,
IMAGE_TAG, SHOPWARE_SHOP_ID, SHOPWARE_DEPLOY_ENV, and all three compose files.
Compose is always:
docker compose --env-file .env [--env-file .env.local] [--env-file .env.prod] -f deploy/compose.yaml -f deploy/compose.prod.yaml -f deploy/compose.vps.yaml
Source of truth is deploy/compose.yaml name: "${SHOPWARE_SHOP_ID:?…}-${SHOPWARE_DEPLOY_ENV:?…}" plus host env files in identity-load order (always .env, then .env.local / .env.prod when those files exist under the shop root). There is no -p. Leftover COMPOSE_PROJECT_NAME in committed .env is ignored (commented out by env init).
Never --build. compose run uses --pull never (not --no-build). compose up
uses --no-build (and --pull never when skipping registry pull). Theme/asset
compile flags stay in the setup helper image.
- If
.deployed-tagexists, copy it to.previous-tag. compose pullunless--skip-pull/SKIP_PULL=1/PULL_POLICY=never.- Start bundled
mysqlif present; startredisif present / profiled. - One-shot
--profile setup run --rm --pull never setup. up -d --no-build(optional--pull never)--remove-orphans web.- Extra
COMPOSE_PROFILES(must not includesetup). - Post-deploy health probe (
curl -fsS, 30 attempts, 2s sleep). Default URL:APP_URLwith trailing slash stripped +/api/_info/health-check. Override withDEPLOY_HEALTH_URL(full URL, used as-is). Write.deployed-tagonly after setup/web succeed and the probe passes (or is skipped). Live (SHOPWARE_DEPLOY_ENV=live) requires a probe URL; refuse before mutating unless--allow-no-deploy-health/ALLOW_NO_DEPLOY_HEALTH=1(ops escape only). Non-live skips the probe when no URL can be resolved. - On deploy-health failure: print
IMAGE_TAG=$(cat .previous-tag) fyrst-cli shopware deploy rollback. Auto-run the shared rollout helper at the previous tag whenROLLBACK_ON_FAILis on (unset → on for live, off otherwise). Release still exits 1 after a successful auto-rollback. First deploy with no.previous-tagcannot auto-rollback.
--dry-run prints that sequence and does not pull, recreate, or write tag files.
--skip-pull sets PULL_POLICY=never.
Loud warning (does not auto-enable) when SHOPWARE_DEPLOY_ENV=live and
COMPOSE_PROFILES is empty. Recommended live: redis,worker,scheduler.
Passwords / DATABASE_URL are never logged. Auto-rollback on deploy-health
failure uses the shared compose/rollout helper
(fyrst-cli shopware deploy rollback).
fyrst-cli shopware db import --file <path.sql|.sql.gz> [--dry-run] [--allow-live]
Also:
fyrst-cli shopware sync apply --data db [--snapshot-dir DIR] [--dry-run]
looks for <snapshot-dir>/db.sql.gz then db.sql and calls the same import
module. Default --snapshot-dir is <shop>/var/runtime-sync. Bind-mount
volumes (media, files, thumbnail, theme, sitemap) restore from
<snapshot-dir>/data/<item>/ (preferred) or
<snapshot-dir>/volumes/<item>.tar.gz.
Finish committed shop-root .env after shopware-cli project create + Flex,
host .env.local for SHOPWARE_DEPLOY_ENV and
COMPOSE_PROJECT_NAME=<shop-id>-<env>, and gitignored compose.override.yaml
(name: <shop-id>-<env>) so local shopware-cli project dev uses the same
Compose project as VPS. Historically mapped to overlay deploy/init-env.sh
(removed). Does not overwrite the whole file, invent MYSQL_* passwords,
set APP_URL, or generate APP_SECRET (shopware-cli project create writes
that). Shared .env must not hold env-specific values. This is not a dump
command.
Resolves shop root (COMPOSE_DIR if set, else walk from cwd for .env or
.env.example + deploy/). .env is KEY=VALUE (quotes stripped, no
shell expansion), same parser as import (src/shopware/envfile.rs).
- Copy
.env.example→.envwhen.envis missing; merge missing keys from.env.examplewithout clobbering existing values (skipsCOMPOSE_PROJECT_NAMEandSHOPWARE_DEPLOY_ENV). --shop-idis required unlessSHOPWARE_SHOP_IDis already non-empty in.env. Slug: lowercase[a-z0-9]([a-z0-9-]*[a-z0-9])?.--envislive|staging|playground|dev. Written to.env.local(gitignored; created if missing) together withCOMPOSE_PROJECT_NAME=<shop-id>-<env>(same string as VPS, e.g.acme-dev). Defaultlivewhen unset and.env.local/.env.prodhave no value; leftover uncommentedSHOPWARE_DEPLOY_ENVin shared.envis migrated then commented out.--imagesetsIMAGE(no whitespace). Unset leavesIMAGEas-is.- Comments out uncommented
COMPOSE_PROJECT_NAME=…in shared.env(create writesCOMPOSE_PROJECT_NAME=sw-…). Does not writeCOMPOSE_PROJECT_NAMEorSHOPWARE_DEPLOY_ENVinto committed.env. Already-commented lines are left as-is. - Upserts top-level Compose
name: <shop-id>-<env>in gitignoredcompose.override.yaml(create if missing; if the file exists, set/replace only that key). Compose andshopware-cli project devauto-readCOMPOSE_PROJECT_NAMEonly from project-directory.env, not.env.local, so the YAMLname:is what names the local stack. shopware-cli regeneratescompose.yamland leavescompose.override.yamlfor local customization. VPS compose interpolates the same<shop-id>-<env>fromdeploy/compose.yamlname:plus host env files (no-p). --dry-runprints the summary and does not write.env,.env.local, orcompose.override.yaml.- After a real write:
chmod 600 .envand.env.local(not the override).
Does not generate APP_SECRET (no dedicated read/write of that key). Refuses a
bash xtrace equivalent (SHELLOPTS=xtrace / BASH_XTRACEFD) so credentials
in .env cannot leak via trace. Summary never prints secret values (MYSQL
passwords).
fyrst-cli shopware deploy rollback [--dry-run] [--skip-pull] [--allow-no-deploy-health]
Resolves shop root (COMPOSE_DIR or walk from cwd for .env + deploy/),
loads .env then .env.local then .env.prod. Process-env wins for IMAGE, DEPLOY_HEALTH_URL,
COMPOSE_PROFILES, SKIP_PULL, PULL_POLICY when non-empty. IMAGE_TAG
from the process environment is ignored — the only tag is shop-root
.previous-tag (overlay vps_read_previous_tag). Missing or empty
.previous-tag exits 1 and does not guess IMAGE_TAG.
Requires IMAGE, SHOPWARE_SHOP_ID, SHOPWARE_DEPLOY_ENV, and the same
compose files as release:
deploy/compose.yaml + compose.prod.yaml + compose.vps.yaml
Rollout order reuses the release compose/rollout helper (never --build;
run uses --pull never, up uses --no-build):
- Pull unless
--skip-pull/SKIP_PULL=1/PULL_POLICY=never. - Start bundled
mysqlif present; startredisif present / profiled. - One-shot
compose --profile setup run --rm --pull never setup. up -d --no-build(optional--pull never)--remove-orphans web.- Extra
COMPOSE_PROFILES(must not includesetup). - Post-deploy health probe (same URL rules as release). Write
.deployed-tagonly after success (and the probe, if a URL was resolved). Probe failure does not update.deployed-tag. Live requires a probe URL unless the ops escape--allow-no-deploy-health/ALLOW_NO_DEPLOY_HEALTH=1is set.
--dry-run prints that sequence and does not pull or recreate containers.
--skip-pull sets PULL_POLICY=never (same-host / air-gap).
Cron/operator pull (run on the consumer, typically staging):
fyrst-cli shopware sync pull --from live --data all
fyrst-cli shopware sync pull --from live --skip-db --data media,files,thumbnail,theme,sitemap --dry-run
--from local snapshots then restores the same host (pipeline check). Prefer
--from <live-alias> on staging.
fyrst-cli shopware backup recover [--data LIST] [--dry-run] --artifact STAMP_OR_DIR \
--i-understand-this-restores-this-host
--artifact (aliases --stamp, --from) is required (artifact timestamp under
$BACKUP_TARGET/$SHOPWARE_SHOP_ID/$SHOPWARE_DEPLOY_ENV/ or a directory path).
Confirmation via --i-understand-this-restores-this-host or
BACKUP_CONFIRM_RESTORE=1. This overwrites DB and bind mounts on this host.
It is not sync apply (clone live→staging).
Resolves shop root (COMPOSE_DIR or walk from cwd for .env + deploy/),
loads .env then .env.local then .env.prod (identity / process-win keys
from the process environment win when non-empty). Requires SHOPWARE_SHOP_ID.
- If a compose
mysqlservice is present: on execute,docker compose … up -d --no-build mysql, wait until pingable, thengzip -dc FILE | docker compose --env-file .env [--env-file .env.local] [--env-file .env.prod] -f … exec -T mysql sh -c '<mysql|mariadb>'(plain.sqlis stdin, not gzip). There is no-p; project name is composename:(VPSdeploy/compose.yamlor localcompose.override.yaml) interpolating host env files. - Else
DATABASE_URLto a real host:gzip -dc FILE | docker run --rm -i --network host <mysql:8.4|mariadb:11.4> mysql <database>. Hostmysqlwithout a bundled service is refused. --dry-runprints that pipeline without passwords /MYSQL_PWD/DATABASE_URLand does not call Docker.
Live consumer (SHOPWARE_DEPLOY_ENV, checkout basename, or hostname equal to
live, case-insensitive):
| Command | Default | Override |
|---|---|---|
db import |
refuse | --allow-live or SHOPWARE_ALLOW_LIVE_RESTORE=1 |
sync apply |
refuse | SHOPWARE_ALLOW_LIVE_RESTORE=1 only |
sync pull |
refuse | SHOPWARE_ALLOW_LIVE_RESTORE=1 only |
| rewrite after apply | skipped on live | none — rewrite is never applied on live |
backup recover |
refuse when SHOPWARE_DEPLOY_ENV=live |
SHOPWARE_ALLOW_LIVE_RESTORE=1 (then inner apply sets the same flag) |
Staging / playground / dev need no extra live flag for backup recover (still need confirmation). Quarterly drill: restore onto staging, not live.
Disaster recovery from a backup artifact onto this host. Historically overlay
deploy/backup-runtime.sh restore (removed). fyrst-cli does not dump.
- Require
--artifact(aliases--stamp,--from) and confirmation (--i-understand-this-restores-this-hostorBACKUP_CONFIRM_RESTORE=1). - If
SHOPWARE_DEPLOY_ENV=live, refuse unlessSHOPWARE_ALLOW_LIVE_RESTORE=1. - Fetch the artifact:
--artifactdirectory path, or- local
$BACKUP_TARGET/<shop>/<env>/<stamp>/(BACKUP_TARGETdefaultlocal), or - SSH
BACKUP_TARGET: rsync into<shop>/var/backup-work/restore-<stamp>(SHOPWARE_SSH_KEYwhen set).
- Set
SHOPWARE_ALLOW_LIVE_RESTORE=1and apply via the same restore module asshopware sync apply(--data db→ existing import ofdb.sql.gz/db.sql; volumes from artifactdata/<item>/thenvolumes/<item>.tar.gz). --dry-runprints the fetch + inner restore plan and does not overwrite DB or bind mounts.- After a real restore, hint to rewrite sales-channel URLs if this is not a same-host drill (rewrite itself is still skipped on live).
Same loader as every other shopware verb (.env / .env.local / .env.prod).
Process-env BACKUP_* and shop identity keys win when non-empty.
Applies --snapshot-dir onto this host. --from is unused for local
apply (kept for clap compatibility with sync capture / sync pull).
- Refuse a live consumer unless
SHOPWARE_ALLOW_LIVE_RESTORE=1(covers volume-only restore, not only db). - If
APP_URLis set and the consumer is live, skip rewrite (never applied on live). Staging / playground / dev rewrite fromAPP_URL. - Stop running compose services
web,worker,scheduler. - If
--dataincludes db: existing import module (db.sql.gzthendb.sql). - If rewrite was requested and db was restored:
docker compose … run --rm --pull never --entrypoint php web bin/console sales-channel:update:domain <host>.<host>isAPP_URLwith scheme and path stripped (port is not passed). If db was skipped, orAPP_URLis unset, rewrite is skipped. Not run whenSHOPWARE_DEPLOY_ENVis live (SHOPWARE_ALLOW_LIVE_RESTOREdoes not enable it). Not part of baredb import. - Restore selected bind-mount items into
SHOPWARE_DATA_ROOTor derived$SHOPWARE_DATA_BASE/$SHOPWARE_SHOP_ID/$SHOPWARE_DEPLOY_ENV(SHOPWARE_DATA_BASEdefaults to/var/lib/shopware/data). Prefer rsync fromdata/<item>/, else extractvolumes/<item>.tar.gz, thenchown 82:82.--dry-runprints rsync/extract/chown and does not copy. - Start previously stopped app services.
- Non-fatal
cache:clearwhenIMAGEis set; hints when rewrite was off.
Passwords are never logged. Rewrite is not a Rust SQL rewriter. The CLI
passes the APP_URL host to Shopware sales-channel:update:domain and does
not replace scheme, port, or path itself.
Copies bind-mount trees (media, files, thumbnail, theme, sitemap)
into --snapshot-dir/data/<item>/. Default --snapshot-dir is
<shop>/var/runtime-sync. Default --from is local. Default --data is
db,media,files,thumbnail,theme,sitemap.
This is not a dump command. fyrst-cli never runs
docker run … shopware-cli project dump and never dumps.
fyrst-cli shopware sync capture [--from ALIAS] [--data LIST] [--snapshot-dir DIR] [--dry-run] [--skip-db] [--skip-volumes]
--data |
Behaviour |
|---|---|
volumes only (--skip-db or --data media,files,…) |
Copy trees; exit 0. --dry-run prints the rsync/tar plan and does not copy. |
db only / --skip-volumes |
Exit 2. Message to run shopware-cli project dump and import with fyrst-cli shopware db import. Not a silent success. |
all (db + volumes) |
Copy volumes and remind the operator to dump with shopware-cli into --snapshot-dir/db.sql.gz. Must not wrap dump. |
mysql_data / redis_data |
Refused (exit 1). |
Local: rsync (or a tree copy if rsync is missing) from
$SHOPWARE_DATA_ROOT / derived
$SHOPWARE_DATA_BASE/$SHOPWARE_SHOP_ID/$SHOPWARE_DEPLOY_ENV/<item>
into --snapshot-dir/data/<item>/. If the bind-mount directory is missing,
named-volume fallback {SHOPWARE_SHOP_ID}-{SHOPWARE_DEPLOY_ENV}_<item> via
alpine:3.20 writes --snapshot-dir/volumes/<item>.tar.gz (identity
project name, matching Compose name:).
Remote --from <alias>: SSH + rsync (or tar over SSH) from
SHOPWARE_REMOTE_DATA_ROOT or derived
$SHOPWARE_DATA_BASE/$SHOPWARE_SHOP_ID/live. Host/user/key from
SHOPWARE_SSH_* (host defaults to the --from alias). Does not dump on
the remote.
Object storage (S3) is out of scope. Dump remains shopware-cli.
Overlay do_sync minus dump wrap. Run on the consumer (staging / playground /
dev). Typical cron: --from live --data all.
- Live refuse unless
SHOPWARE_ALLOW_LIVE_RESTORE=1. Rewrite fromAPP_URLis skipped on live. - SSH probe (
SHOPWARE_SSH_*; dry-run prints the probe and does not connect). Host defaults to the--fromalias. - Stop
web/worker/schedulerif running (dry-run prints the plan). - DB: fyrst-cli does not dump and does not SSH a dump wrapper. If
--dataincludesdb, import<snapshot-dir>/db.sql.gz(thendb.sql) with the existing import module. If no dump is present, exit 1 with operator instructions to runshopware-cli project dumpon the source and placedb.sql.gzfor import (fyrst-cli shopware db import --fileis the same module).--skip-dbskips this leg. sales-channel:update:domain <host>whenAPP_URLis set and a dump was imported on a non-live consumer.<host>is theAPP_URLhost (scheme and path stripped; port is not passed). Skipped when--skip-db/ no dump imported / live /APP_URLunset.SHOPWARE_ALLOW_LIVE_RESTOREdoes not enable it. Not part of baredb import.- Volume leg: rsync
SHOPWARE_REMOTE_DATA_ROOT/<item>/(or derived{data_base}/{shop_id}/live) → local$DATA_ROOT/<item>/(tar/docker fallback if rsync cannot write), thenchown 82:82.--dry-runprints rsync without copying. - Start previously stopped app services; non-fatal cache:clear.
--from local is documented as a capture+apply pipeline check (rsync
through --snapshot-dir), not the cron path.
SSH env (not clap): SHOPWARE_SSH_HOST (default --from alias),
SHOPWARE_SSH_USER, SHOPWARE_SSH_KEY, SHOPWARE_REMOTE_DATA_ROOT.
Passwords are never logged.
fyrst-cli shopware sync local [--from ALIAS] [--data LIST] [--remote-data-root PATH] [--delete] [--dry-run]
Pull live VPS upload trees into a laptop shopware-cli project-dev
checkout. Historically overlay deploy/sync-runtime-local.sh (removed). This command
never restores the database and never writes into local
SHOPWARE_DATA_ROOT (that is the VPS bind-mount root).
VPS→VPS including DB is shopware sync pull, not this command.
Default --from is live. Default --data (when omitted) is
media,files,thumbnail,theme,sitemap. --data all is refused so all
never implies db on this verb (on sync pull / backup create, all
includes db).
Path remap (remote $REMOTE_DATA_ROOT → local shopware-cli project tree):
| Remote | Local |
|---|---|
media/ |
./public/media/ |
files/ |
./files/ |
thumbnail/ |
./public/thumbnail/ |
theme/ |
./public/theme/ |
sitemap/ |
./public/sitemap/ |
- Resolve shop root (
COMPOSE_DIRor walk from cwd for.env+deploy/). Requirepublic/orcomposer.json. - Same loader as every shopware verb:
.env,.env.local,.env.prod(identity keys from the process environment win when non-empty). - Remote root:
--remote-data-root/SHOPWARE_REMOTE_DATA_ROOT, else$SHOPWARE_DATA_BASE/$SHOPWARE_SHOP_ID/live(SHOPWARE_DATA_BASEdefault/var/lib/shopware/data).SHOPWARE_SHOP_IDis required unless an explicit remote root is set. - SSH: BatchMode, no password prompts. Host/user/key from
SHOPWARE_SSH_*(host falls back to--from). Port is always22. --data db/database/mysqlis refused (dump/import separately:shopware-cli project dump+fyrst-cli shopware db import).--data allis refused (onsync pull/backup create,allincludes db).--data mysql_data/redis_datarefused.--deleteis opt-in (rsync --delete). Default keeps extra local files. rsync is-azHand omits--numeric-idsso files are owned by the local user, not VPS uid 82.--dry-runprints eachhost:remote/item/ → ./public/…(or./files/) mapping and the rsync line; skips SSH probe / copy. Still requiresrsyncandsshon PATH.- Warns if the checkout directory is named
live. After success (and dry-run): remindershopware-cli project console cache:clear(not implemented here).
Requires rsync and an OpenSSH ssh client.
fyrst-cli shopware backup create [--data LIST] [--dry-run]
Default --data: db,media,files,thumbnail,theme,sitemap.
BACKUP_TARGET (local path, second disk, or SSH user@host:/path /
ssh://user@host:22/abs/path; default local under the shop). Also
BACKUP_KEEP_DAYS (default 14, 0 = keep forever). SSH targets reuse
SHOPWARE_SSH_*. Identity: SHOPWARE_SHOP_ID, SHOPWARE_DEPLOY_ENV.
Optional BACKUP_DB_DUMP = path to an already-made db.sql.gz (or .sql)
to copy into the artifact. Same loader as every shopware verb; process-env
BACKUP_* values win when non-empty.
Layout on BACKUP_TARGET:
$BACKUP_TARGET/$SHOPWARE_SHOP_ID/$SHOPWARE_DEPLOY_ENV/YYYYMMDDTHHMMSSZ/
db.sql.gz # operator / shopware-cli, not fyrst-cli dump
data/media/ …
BACKUP_MANIFEST.txt
SHA256SUMS # when sha256sum exists
Off-host backup of runtime artifacts. Sync is not a backup. Live
(SHOPWARE_DEPLOY_ENV=live) is allowed and expected (cron on live).
Historically overlay deploy/backup-runtime.sh backup (removed). fyrst-cli
never wraps shopware-cli project dump and never shells out to
shopware-cli.
- Resolve shop root; load
.env,.env.local,.env.prod. RequireSHOPWARE_SHOP_ID,SHOPWARE_DEPLOY_ENV.BACKUP_TARGETdefaults tolocal. - Lock overlapping runs (
var/backup-runtime.lock/ flock). - Copy selected bind-mount trees from
$SHOPWARE_DATA_ROOT/<item>/(or derived$SHOPWARE_DATA_BASE/$SHOPWARE_SHOP_ID/$SHOPWARE_DEPLOY_ENV) intodata/<item>/. Missing bind-mounts fall back to a named-volume tar ({SHOPWARE_SHOP_ID}-{SHOPWARE_DEPLOY_ENV}_<item>,alpine:3.20; identity name matching Composename:). Local target writes the timestamped dir in place; SSH target builds under<shop>/var/backup-work/<stamp>then rsyncs (SHOPWARE_SSH_KEY). - If
--dataincludesdb: do not dump.--dry-runprints “run shopware-cli project dump yourself”. Execute copiesBACKUP_DB_DUMPinto the artifact asdb.sql.gz(ordb.sql). Missing dump fails (exit 1) with that instruction — it does not wrap shopware-cli. - Write
BACKUP_MANIFEST.txtandSHA256SUMS(whensha256sumexists). - After a successful artifact, run the in-process retention helper
(same stamp cutoff as overlay
prune_artifacts: deleteYYYYMMDDTHHMMSSZdirs older thanBACKUP_KEEP_DAYSUTC days;0keeps forever; non-matching names are left alone). Standalonefyrst-cli shopware backup pruneis the same retention path.
--dry-run prints the stamp path, volume copy plan, dump instruction (if
db selected), manifest/checksum plan, and prune actions. It does not copy,
dump, SSH, or delete.
fyrst-cli shopware backup prune [--data LIST] [--dry-run]
--data is accepted for overlay flag parity. Prune deletes artifact
directories by timestamp name, not by --data subset.
Stamp-based retention under
$BACKUP_TARGET/$SHOPWARE_SHOP_ID/$SHOPWARE_DEPLOY_ENV/. Not a dump
command and does not wrap shopware-cli. Creating artifacts is
shopware backup create.
Resolves shop root (COMPOSE_DIR or walk from cwd for .env + deploy/),
loads .env then .env.local then .env.prod. Identity keys and
BACKUP_TARGET / BACKUP_KEEP_DAYS / SHOPWARE_SSH_KEY from the process
environment win when non-empty. Requires SHOPWARE_SHOP_ID and
SHOPWARE_DEPLOY_ENV. BACKUP_TARGET defaults to local.
- Parse
BACKUP_TARGETas a local path,user@host:/path/host:/path, orssh://user@host:22/abs/path. UnsetBACKUP_TARGETuseslocalunder the shop (not “not implemented”). BACKUP_KEEP_DAYSdefault 14.0logs that all artifacts are kept and returns without listing or deleting.- List names under the shop/env prefix. Delete those whose name matches
YYYYMMDDTHHMMSSZand is older than the UTC cutoff (stamp < now minus keep days, same string compare as overlaydate -u -d). Names that are not that stamp form are left alone. A stamp equal to the cutoff is kept. --dry-runprintsrm -rftargets and does not delete.- SSH targets use
ssh -o BatchMode=yes -o ConnectTimeout=15(-pfrom thessh://URL or22; optional-i SHOPWARE_SSH_KEY) and remoterm -rf.
Live is allowed (this is retention, not sync apply).
This CLI reads shop identity and secrets from the environment / shop-root
.env / .env.local / .env.prod. New names only:
| Area | Variables |
|---|---|
| Shop identity | COMPOSE_DIR, SHOPWARE_SHOP_ID (shared .env), SHOPWARE_DEPLOY_ENV and COMPOSE_PROJECT_NAME=<shop-id>-<env> (.env.local / .env.prod), SHOPWARE_DATA_BASE, SHOPWARE_DATA_ROOT. Do not put COMPOSE_PROJECT_NAME or SHOPWARE_DEPLOY_ENV in committed .env. Local Compose project is <shop-id>-<env> via host .env.local plus gitignored compose.override.yaml name: (not the folder basename). Compose SoT for VPS, db import, and rewrite is name: interpolating host env files (no -p). |
| Env init | IMAGE (APP_SECRET is Shopware's; shopware-cli project create writes it) |
| Import | MYSQL_DATABASE, DATABASE_URL, SHOPWARE_ALLOW_LIVE_RESTORE |
| Restore volumes | SHOPWARE_DATA_ROOT, SHOPWARE_DATA_BASE |
| Rewrite | APP_URL, IMAGE |
| Dump (shopware-cli only) | Use shopware-cli project dump. fyrst-cli does not dump. |
| Release | IMAGE, IMAGE_TAG (release / .env; ignored on rollback), COMPOSE_PROFILES, DEPLOY_HEALTH_URL (default from APP_URL + /api/_info/health-check), ALLOW_NO_DEPLOY_HEALTH, PULL_POLICY, SKIP_PULL, ROLLBACK_ON_FAIL |
| Rollback | .previous-tag is the only IMAGE_TAG; same optional env as release except ROLLBACK_ON_FAIL |
| SSH / remote live data | SHOPWARE_SSH_HOST, SHOPWARE_SSH_USER, SHOPWARE_SSH_KEY, SHOPWARE_REMOTE_DATA_ROOT |
| Live gate | SHOPWARE_ALLOW_LIVE_RESTORE |
| Backup | BACKUP_TARGET (default local), BACKUP_KEEP_DAYS (default 14, 0 = forever), BACKUP_DB_DUMP, BACKUP_CONFIRM_RESTORE |
The six overlay scripts and the recipe dispatcher are removed. Operators
and CI call fyrst-cli shopware … only. Dump remains
shopware-cli project dump forever — fyrst-cli does not dump, wrap dump, or
shell out to shopware-cli. Recipe and shopware-cd product code stay out of
this repo. Do not reimplement rewrite in SQL; sync apply calls compose web
console. Rollback reuses the release compose/rollout helper.