Answers.Body: <p>If you run <code>drush civicrm-sql-dump --help</code> the output is:</p>
  
  <pre><code>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.
  </code></pre>
  
  <p>So since you want it in a file rather than on your screen, use the <code>--result-file</code> option and tell it what file you want to write to.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-01-02T16:25:08.627Z
Answers.Text: 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."`
Answers.UserDisplayName: Ken Williams
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-01-02T16:26:28.167Z
Answers.Text: Or is that help text supposed to apply to the full command with `--result-file` argument included?  The formatting makes that unclear.
Answers.UserDisplayName: Ken Williams
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-01-06T10:29:14.630Z
Answers.Text: ``"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.
Answers.UserDisplayName: Aidan
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-12-22T09:13:01.393Z
Answers.LastActivityDate: 2016-12-22T09:13:01.393Z
Answers.UserDisplayName: Aidan
Body: <p>My attempt to backup my civicrm database using <code>mysqldump</code> has failed after a very rocky CiviCRM upgrade process, or it is taking way too long, so I am trying the drush command, <code>drush civicrm-sql-dump</code> 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? </p>
  
Tags: <drupal><database><mysql><drush><backups>
Title: Syntax for drush command civicrm-sql-dump
ThreadText: # Syntax for drush command civicrm-sql-dump
  
  (Asked by: username_0 on 2016-12-22)
  
  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?
  
  **Tags:** drupal, database, mysql, drush, backups
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2016-12-22. Score: 1 | Accepted 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.
  
  > **Comments:**
  > **username_2**: 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."`  
  > **username_2**: Or is that help text supposed to apply to the full command with `--result-file` argument included?  The formatting makes that unclear.  
  > **username_1**: ``"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.  
  
  ---
  
  