Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Passing no-tablespaces flag into drush sql-dump for task #2939

Merged
merged 4 commits into from
Nov 30, 2021

Conversation

timclifford
Copy link
Contributor

Checklist

  • Affected Issues have been mentioned in the Closing issues section
  • Documentation has been written/updated
  • PR title is ready for changelog and subsystem label(s) applied

Explain the details for making this change. What existing problem does the pull request solve?

Closing issues

Put closes #XXXX in your comment to auto-close the issue that your PR fixes (if such).

@tobybellwood tobybellwood added this to the v2.4.0 milestone Nov 22, 2021
@tobybellwood
Copy link
Member

ok (another comment incoming about the drush version command) but broadly this works on Drush9/10

in Drush 8, the issues in drush-ops/drush#4489 arise, namely that whilst the dump works, it doesn't truncate the cache or watchdog tables, resulting in a potentially enormous backup.

Will continue digging

@tobybellwood
Copy link
Member

so, to replicate the truncating of a "common" structure-tables-list
$command_specific['sql-dump'] = array('structure-tables-list' => 'cache,cache_*,history,sessions,watchdog,feeds_log');

drush sql-dump --extra=--no-tablespaces | grep -Ev 'INSERT INTO `(cache|cache_|history|sessions|watchdog|feeds_log)' | gzip > $file.gz

or similar via awk (fewer matches for brevity)

drush sql-dump --extra=--no-tablespaces | awk '!/INSERT INTO `cache_ && !/INSERT INTO `watchdog' | gzip > $file.gz

The question is - do we want to define which tables aren't dumped for customers....

@tobybellwood
Copy link
Member

ok - going to press ahead with this - large dumps are better than broken dumps.

@tobybellwood tobybellwood marked this pull request as ready for review November 29, 2021 20:25
@tobybellwood tobybellwood merged commit 7db821b into main Nov 30, 2021
@tobybellwood tobybellwood deleted the hotfix/drush-sql-dump-no-tablespaces branch November 30, 2021 06:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants