Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions products/tools/cli/project-commands/mysql-dump.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ Some tables are not relevant for dumps, like log tables. To ignore some default
- `version_commit`
- `version_commit_data`
- `webhook_event_log`
- `webhook_delivery`
- `webhook_stream`

To exclude additional table data from every dump, use `dump.nodata` in `.config/shopware-project.yml`. Table schemas are still exported. Table names and glob patterns are supported; tables that are absent are skipped.

Expand All @@ -120,6 +122,36 @@ dump:
- 'my_plugin_log_*'
```

## Resetting the shop identity

When copying a shop to another environment, use `--reset-identity` to remove the source shop's app identity from the dump. The source database is unchanged.

```bash
shopware-cli project dump --reset-identity --output identity.sql
```

This omits `core.app.shopId` and `core.app.shopIdV2` from system configuration, so the destination can generate its own shop ID. It also omits the following database records:

- App records with completed or pending registrations
- Integrations and API credentials belonging to those apps
- Registration secrets retained for previously deleted apps

The dump omits related records linked through `CASCADE` foreign keys, such as app action buttons and their translations. Records linked through `SET NULL` foreign keys remain, but their references to omitted records are cleared. This preserves payment and shipping registrations and existing order references, allowing Shopware to reconnect the registrations when an app is reinstalled.

Apps without completed or pending registration secrets are kept in the dump, including their related records. This includes local-only apps that have not registered with an app server. Unrelated API integrations also keep their records and credentials.

Reinstall the removed apps in the destination shop to register them under its new identity. Their app files must be available in the destination project.

Use `--clone-shop` as shorthand for `--clean --reset-identity` to also omit transient data such as pending jobs and webhook delivery logs. Combine it with `--anonymize` to anonymize personal data and extension-declared sensitive data.

```bash
shopware-cli project dump --clone-shop --anonymize --output clone.sql
```

Identity reset can be combined with the other dump options and project configuration.

If affected foreign keys share columns and their delete actions could conflict, the command stops with an error.

## Ignoring entire tables

It is also possible to completely ignore a table **not only the content**.
Expand Down
Loading