Skip to content

Instantly share code, notes, and snippets.

@rodricels
Created December 7, 2020 16:19
Show Gist options
  • Save rodricels/a6c3fe63c462647c80625c960da03181 to your computer and use it in GitHub Desktop.
Save rodricels/a6c3fe63c462647c80625c960da03181 to your computer and use it in GitHub Desktop.
Drush mysql dump by tables
#!/bin/bash
for i in $(drush sqlq "show tables;"|grep -v Tables_in_);
do
drush sql:dump --tables-list=$i --result-file=wherever-you-need/backup-$i.sql;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment