n98-magerun
n98-magerun copied to clipboard
Option for stripped dumps to not drop tables
Tables in the stripped groups are automatically added to the first mysqldump line so that they are exported as structure-only. There are times when the dump is being created to import into an existing database where those tables (e.g. sales, customers) should not be deleted by dropping tables, so the first mysqldump is not required. An option like "--no-structure-only" would be useful.
+1!
Also related: In this case it would be nice to be able to configure a whitelist of tables (instead of a blacklist/stripped). This way you could n98-magerun e.g. to export cms content from one environment and import it into another one. Reusing the same mechanism for configuring for table groups would be great.
@fbrnc nice.
In the short term, this will work from bash:
n98-magerun.phar db:dump --only-command --strip="@development" --stdout | tail -n 1 | sh -s
The idea of db:dump (also with --strip) is, that we get a full Magento database structure after importing. With such an option, we can only import onto an existing database. I think this is a quite special usecase. The workaround might be enough? What do you think?
Thanks for your response Alex. I'm happy to continue using the workaround if that's what is best for the project.
In the internal tools I built to pull a remote database over SSH, I'm pulling a structure only dump followed by a data dump with the appropriate exclusions. Both of them go through filters to remove DEFINERS on triggers, but it solves the problem of having to pull over an existing database, something which can cause trouble if you have different versions of install scripts. Maybe a similar thing could work here?
David Alger, CTO, Classy Llama Sent from my iPhone 4S
On Jul 28, 2013, at 5:49 AM, Jonathan Day [email protected] wrote:
Thanks for your response Alex. I'm happy to continue using the workaround if that's what is best for the project.
— Reply to this email directly or view it on GitHubhttps://github.com/netz98/n98-magerun/issues/138#issuecomment-21681663 .
Never mind me... I apparently didn't read the first part of this thread, and only the last bit of it in my email. :)
David Alger, CTO, Classy Llama Sent from my iPhone 4S
On Jul 28, 2013, at 5:49 AM, Jonathan Day [email protected] wrote:
Thanks for your response Alex. I'm happy to continue using the workaround if that's what is best for the project.
— Reply to this email directly or view it on GitHubhttps://github.com/netz98/n98-magerun/issues/138#issuecomment-21681663 .
This ticket and the workaround saved me. Please add a --non-destructive
option.