netz98 / n98-magerun2

The swiss army knife for Magento developers, sysadmins and devops. The tool provides a huge set of well tested command line commands which save hours of work time. All commands are extendable by a module API.
https://magerun.net
Other
859 stars 220 forks source link

Trade/customer data for a subset of users. #1077

Open damienwebdev opened 1 year ago

damienwebdev commented 1 year ago

Feature description

I would love to be able to generate a subset of trade/customer in my db:dump --strip="@development" for a subset of users, i.e. those with emails like @company.com or those customers with entity_id 1,2,3,4.

Problem and motivation

I'm trying to generate development backups for testing database schema migrations on existing data.

Is this something you're interested in working on

I'll probably write some sql locally and paste it here, however, I don't know how to bring the feature in Magerun.

cmuench commented 1 year ago

Maybe the same as described in #1010

damienwebdev commented 1 year ago

@cmuench this is definitely very similar and would leverage --where under the hood. I've collected the set of tables I'm interested in my environment here, but there would probably be extension tables that are also of interest to people doing this exact thing, perhaps we could provide a dictionary of ["tableName" => "entityIdColumn"] that could allow a dev to expand on the set of tables.

`newsletter_subscriber`

`sales_creditmemo`
`sales_creditmemo_comment`
`sales_creditmemo_grid`
`sales_creditmemo_item`

`sales_invoice`
`sales_invoice_comment`
`sales_invoice_grid`
`sales_invoice_item`

`sales_order`
`sales_order_address`
`sales_order_grid`
`sales_order_item`
`sales_order_payment`
`sales_order_status_history`
`sales_order_tax`
`sales_order_tax_item`

`sales_shipment`
`sales_shipment_comment`
`sales_shipment_grid`
`sales_shipment_item`
`sales_shipment_track`

`sales_payment_transaction`

`customer_address_entity`
`customer_address_entity_datetime`
`customer_address_entity_decimal`
`customer_address_entity_int`
`customer_address_entity_text`
`customer_address_entity_varchar`
`customer_eav_attribute`
`customer_eav_attribute_website`
`customer_entity`
`customer_entity_datetime`
`customer_entity_decimal`
`customer_entity_int`
`customer_entity_text`
`customer_entity_varchar`