Last active
February 2, 2019 20:11
-
-
Save crittermike/3503791 to your computer and use it in GitHub Desktop.
Import gzipped MySQL DB dump but ignore data from specific tables
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# REGULAR VERSION | |
gunzip -c db.sql.gz | grep -Ev "^INSERT INTO \`(cache_|search_|sessions|whatever)" | mysql -u root -p databasename | |
# DRUPAL VERSION | |
gunzip -c db.sql.gz | grep -Ev "^INSERT INTO \`(cache_|search_|sessions|whatever)" | drush sqlc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nice gist man!!! Thanks Critter