Answers.Body: <p>You can use drush cv to update the settings in db. </p>
  
  <p>eg <code>drush cvapi Setting.create environment="Production"</code> </p>
  
  <p>You can find various options in API explorer to set other settings and see for command in cv and drush section.</p>
  
  <p><a href="https://i.sstatic.net/tH5wo.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/tH5wo.png" alt="enter image description here"></a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-28T15:54:54.463Z
Answers.LastActivityDate: 2018-08-28T15:54:54.463Z
Answers.UserDisplayName: Pradeep Nayak
Body: <p>There are some common settings to change for dev sites at mycivi.localhost/civicrm/admin/setting/debug.  How can those be changed from the command line?</p>
  
  <p>A better answer for the question <a href="https://civicrm.stackexchange.com/questions/9756/how-should-i-copy-a-site-from-production-to-staging">How should I copy a site from production to staging?</a> would include this information I think.</p>
  
  <p>I see on <a href="https://docs.civicrm.org/sysadmin/en/latest/misc/staging-production/" rel="nofollow noreferrer">https://docs.civicrm.org/sysadmin/en/latest/misc/staging-production/</a> that <code>$civicrm_setting['domain']['environment'] = 'Development';</code> can be placed in civicrm.settings.php, which I would expect would be sufficient(though it doesn't seem to affect what's displayed at /civicrm/admin/setting/debug)... but what about other settings like debugging and backtrace?</p>
  
  <p>If I do <code>drush vget</code> I get a list of all kinds of Drupal settings that can be changed via <code>drush vset</code>.  Does CiviCRM have a comparable utility?  I tried <code>cv</code> and wondered if <code>cv vars:show</code> and <code>cv vars:fill</code> might be corresponding commands, but if they are I don't know how to use them to do anything useful.</p>
  
Tags: <settings><cli>
Title: how to change civicrm settings from command line?
ThreadText: # how to change civicrm settings from command line?
  
  (Asked by: username_0 on 2018-08-28)
  
  There are some common settings to change for dev sites at mycivi.localhost/civicrm/admin/setting/debug. How can those be changed from the command line?
  
  A better answer for the question [How should I copy a site from production to staging?](https://civicrm.stackexchange.com/questions/9756/how-should-i-copy-a-site-from-production-to-staging) would include this information I think.
  
  I see on <https://docs.civicrm.org/sysadmin/en/latest/misc/staging-production/> that `$civicrm_setting['domain']['environment'] = 'Development';` can be placed in civicrm.settings.php, which I would expect would be sufficient(though it doesn't seem to affect what's displayed at /civicrm/admin/setting/debug)... but what about other settings like debugging and backtrace?
  
  If I do `drush vget` I get a list of all kinds of Drupal settings that can be changed via `drush vset`. Does CiviCRM have a comparable utility? I tried `cv` and wondered if `cv vars:show` and `cv vars:fill` might be corresponding commands, but if they are I don't know how to use them to do anything useful.
  
  **Tags:** settings, cli
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2018-08-28. Score: 2 | Accepted answer
  
  You can use drush cv to update the settings in db.
  
  eg `drush cvapi Setting.create environment="Production"`
  
  You can find various options in API explorer to set other settings and see for command in cv and drush section.
  
  [![enter image description here](https://i.sstatic.net/tH5wo.png)](https://i.sstatic.net/tH5wo.png)
  
  
  ---
  
  