1

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?

1

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." – Ken Williams Jan 2 '17 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. – Ken Williams Jan 2 '17 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 Jan 6 '17 at 10:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.