Drupal Drush

Drupal 8 Drush SQL Export

Using Drupal 8 Drush 9 you can export your database with the help of the following command.

drush sql-dump --result-file=name.sql

If you want your database to be exported as compressed, you can use the command below.

drush sql-dump --gzip --result-file=name.sql


Drupal 8 Drush SQL Import

You can use the following code to import mysql using Drupal 8 drush 9. You can change the database name in the following command to match the name of the database.

drush sql-cli < database.sql