My attempt to backup my civicrm database using mysqldump
has failed after a very rocky CiviCRM upgrade process, or it is taking way too long, so I am trying the drush command, drush civicrm-sql-dump
in drush 7.0.0 on what I hope is finally CiviCRM 4.7.13 but the command is just dumping to the screen. What other information should I provide?
Add a comment
|
1 Answer
If you run drush civicrm-sql-dump --help
the output is:
Prints the whole CiviCRM database to STDOUT or save to a file.
Examples:
drush civicrm-sql-dump Save SQL dump to the directory above Drupal root.
--result-file=../CiviCRM.sql
Options:
--data-only Dump data without statements to create any of the schema.
--gzip Compress the dump using the gzip program which must be in your $PATH.
--result-file Save to a file.
--tables-list comma-separated list of tables to transfer.
So since you want it in a file rather than on your screen, use the --result-file
option and tell it what file you want to write to.
-
If the default behavior is to print to the screen, then the help text is wrong - it claims to save
"to the directory above Drupal root."
Commented Jan 2, 2017 at 16:25 -
Or is that help text supposed to apply to the full command with
--result-file
argument included? The formatting makes that unclear. Commented Jan 2, 2017 at 16:26 -
"to the directory above Drupal root."
is the help text for the example command that includes--result-file=../CiviCRM.sql
I agree the formatting could be better... and that help text assumes you are running the command from Drupal root.– Aidan ♦Commented Jan 6, 2017 at 10:29