Skip to content

db:dump --strip option misses exporting structure in databases with table prefixes #1812

@martin-cod

Description

@martin-cod

Describe the bug

Given
Magento Database with tables prefix, i.e. prefix_
magerun2 version 9.1.0 or 9.0.2

When

Executing the command with --strip option, i.e.

magerun2.phar db:dump --no-tablespaces --strip="sales_invoice" --only-command dump.sql

Then

Result is the following:

mysqldump --single-transaction --quick --no-tablespaces --column-statistics=0  --ignore-table=database.prefix_sales_invoice 'database'

Expected

mysqldump --single-transaction --quick --no-tablespaces --column-statistics=0 --no-data 'database' prefix_sales_invoice
mysqldump --single-transaction --quick --no-tablespaces --column-statistics=0  --ignore-table=database.prefix_sales_invoice 'database'

So, the structure of stripped tables is missed when tables are prefixed. --strip turns into --exclude in this case

Expected behaviour

The --strip option works the same as for the databases where tables are not prefixed.

Extra info

I use a shared config among different servers with custom table groups. --strip option doesn't work on servers where tables are prefixed. Default table groups, like @admin and @sales don't work either.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions