Answers.Body: <p>There are a few things that can help you out:</p>
  
  <ul>
  <li>Most importantly, the API Explorer (<strong>Support menu » Developer » API Explorer</strong>).  It will build your <code>drush</code> command for you through a GUI.</li>
  <li>You can see there that adding an option with "limit=0" will return all records.</li>
  <li>There's documentation built into the API explorer, but there's also <a href="https://docs.civicrm.org/dev/en/latest/api/" rel="nofollow noreferrer">API documentation in the Developer's Guide</a>.</li>
  <li>One major caveat!  <code>drush</code> and <code>export.php</code> don't really handle JSON inputs well - which you need to pass options.  Instead, use <code>cv</code>.</li>
  <li><a href="https://github.com/civicrm/cv" rel="nofollow noreferrer">cv</a> is like drush, but for CiviCRM.  This can take arguments similar to <code>export.php</code> but can also get JSON as an input, for instance:</li>
  </ul>
  
  <pre><code> echo '{"options": {"limit":0}, "first_name": "Juliann"}' | cv api Contact.get --in=json --out=csv 
  </code></pre>
  
  <p>To use <code>cv</code> with the API explorer for simple commands, just use the recommended <code>cv</code> command.  However, if the command includes JSON, use the format above, and grab the exact JSON from the JavaScript example API Explorer generates.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-06-29T06:51:30.590Z
Answers.Text: Many thanks Jon - I'll try these suggestions and let you know how I get on.
Answers.UserDisplayName: Neil
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-06-28T17:26:12.587Z
Answers.LastActivityDate: 2019-06-28T17:26:12.587Z
Answers.UserDisplayName: Jon G - Megaphone Tech
Body: <p>I'm using an older version of CiviCRM (4.6) with Drupal 7 on Linux and until now I've not really used the command line stuff for CiviCRM, only for Drupal.</p>
  
  <p>But I now need to do exports &amp; imports of contacts etc to &amp; from CiviCRM and so I've installed Drush &amp; got it working. I've tried doing an export with the export.php script with Drush and can manipulate the search results to some degree. But for some reason if only exports the first 26 rows ... is the a parameter that I should be using to get the full rowcount?</p>
  
  <p>Also, where is the best place to get a more detailed list of examples, list of possible parameters, usage notes etc?</p>
  
  <p>Any pointers appreciated, thanks!</p>
  
  <p>Neil</p>
  
Tags: <import><export><drush><cli>
Title: Need help with export.php (CiviCRM 4.6 & Drupal 7)
ThreadText: # Need help with export.php (CiviCRM 4.6 & Drupal 7)
  
  (Asked by: username_0 on 2019-06-27)
  
  I'm using an older version of CiviCRM (4.6) with Drupal 7 on Linux and until now I've not really used the command line stuff for CiviCRM, only for Drupal.
  
  But I now need to do exports & imports of contacts etc to & from CiviCRM and so I've installed Drush & got it working. I've tried doing an export with the export.php script with Drush and can manipulate the search results to some degree. But for some reason if only exports the first 26 rows ... is the a parameter that I should be using to get the full rowcount?
  
  Also, where is the best place to get a more detailed list of examples, list of possible parameters, usage notes etc?
  
  Any pointers appreciated, thanks!
  
  username_0
  
  **Tags:** import, export, drush, cli
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-06-28. Score: 1
  
  There are a few things that can help you out:
  
  Most importantly, the API Explorer (Support menu » Developer » API Explorer).  It will build your drush command for you through a GUI.
  You can see there that adding an option with "limit=0" will return all records.
  There's documentation built into the API explorer, but there's also API documentation in the Developer's Guide.
  One major caveat!  drush and export.php don't really handle JSON inputs well - which you need to pass options.  Instead, use cv.
  cv is like drush, but for CiviCRM.  This can take arguments similar to export.php but can also get JSON as an input, for instance:
  
   echo '{"options": {"limit":0}, "first_name": "Juliann"}' | cv api Contact.get --in=json --out=csv 
  
  To use cv with the API explorer for simple commands, just use the recommended cv command.  However, if the command includes JSON, use the format above, and grab the exact JSON from the JavaScript example API Explorer generates.
  
  > **Comments:**
  > **username_0**: Many thanks Jon - I'll try these suggestions and let you know how I get on.  
  
  ---
  
  