-
-
Save keopx/c7ecd3b70d9672564f5a to your computer and use it in GitHub Desktop.
gunzip -c database.sql.gz | drush sqlc |
drush sqlq --file=db.sql.gz
works, but make sure you drop the database first, else it might result with an error on import.
So the full command would be:
drush sql-drop && drush sqlq --file=db.sql.gz
You are still prompted for confirmation before it starts deleting tables.
drush sqlq --file=db.sql.gz
works, but make sure you drop the database first, else it might result with an error on import.
So the full command would be:
drush sql-drop && drush sqlq --file=db.sql.gz
You are still prompted for confirmation before it starts deleting tables.
That doesn't seem to deal with the zipped file though. It didn't for me, anyway.
drush sqlq --file=db.sql.gz
works, but make sure you drop the database first, else it might result with an error on import.
So the full command would be:
drush sql-drop && drush sqlq --file=db.sql.gz
You are still prompted for confirmation before it starts deleting tables.That doesn't seem to deal with the zipped file though. It didn't for me, anyway.
That's because only gzip seems to be supported by drush sql-query (sqlq) command -> https://drushcommands.com/drush-8x/sql/sql-query/ (under --file option)
zcat seems to be the right solution.
I used to use this method :
gunzip < /path/to/file.sql.gz | drush sql-cli --database=default
drush sqlq --file=db.sql.gz