database:dump

Dump structure and contents of a database

Usage:

drupal database:dump [arguments] [options]
dbdu

Available options

OptionDetails

--file

The filename for your database backup

--gz

Pass this option if you want the sql result file gzipped

--exclude-cache

commands.database.dump.options.exclude.cache

Available arguments

ArgumentDetails

database

Database key from settings.php

target

Database target from settings.php

Examples

Dump default database or the one specified on the argument

drupal database:dump \
  <database>

Dump in gz compressed format

drupal database:dump \
  --gz