Drush 9, commands for db, site-aliases

drush sql-dump --result-file="../db/db.sql" - export db
drush sql-drop - drop the current database
drush sqlc < db.sql import db

A site-alias in drush/sites/self.site.yml

self:
  host: fwi.local
  user: sve
  root: /var/www/vhosts/fwi.local/web
  uri: <a href="https://fwi.local
">https://fwi.local
</a>  paths:
    - files: sites/default/files
    - files-private: sites/default/files-private
  command:
    sql:
      sync:
        options:
          no-dump: true
      dump:
        structure-tables-list: 'cache, cache_*, cachetags, sessions, watchdog'
    core:
      rsync:
        options:
          mode: rlptz
          exclude-paths: 'css:js:tmp:php:styles'

note that the 'dump' part did not work, but passing it in command line works drush sql-dump --result-file="../db/db.sql" --structure-tables-list="cache, cache_*, cachetags, sessions, watchdog" (e.g. to not export the data from this tables)

Category: