Answers.Body: <p>Setting the environment to Staging/Development will turn off all schedule job from running unless you explicitly specify <code>runInNonProductionEnvironment=TRUE</code> in job parameter and also no emails will be send out from CiviCRM to any contact(will be logged in a file on server disk)</p>
  
  <p>You can set the option to Staging/Development using one of the below methods</p>
  
  <ol>
  <li><p>CiviCRM >> Administer >> Debugging and Error Handling, Select option for 'Environment'</p></li>
  <li><p><code>cv api Setting.create environment="Staging"</code> </p></li>
  <li><p><code>drush cvapi Setting.create environment="Staging"</code> </p></li>
  <li><p>Over-ride settings by adding below lines in civicrm.settings.php</p></li>
  </ol>
  
  <p>:</p>
  
  <pre><code>global $civicrm_setting
  $civicrm_setting['domain']['environment'] = 'Production';
  define( 'CIVICRM_MAIL_LOG', '/Users/pradeep/Sites/drupal7/sites/default/files/civicrm/templates_c//mail.log');
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-20T17:58:26.293Z
Answers.Text: Fantastic, thanks! The drush command is exactly what I needed.
Answers.UserDisplayName: Sleewok
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-19T01:04:54.493Z
Answers.LastActivityDate: 2020-02-19T01:04:54.493Z
Answers.UserDisplayName: Pradeep Nayak
Body: <p>I'm working on migrating our site to a different server. I need to do some testing on the new server while keeping the production site live. The problem is that the test server continues to run all the scheduled jobs and recurring contributions. I read about changing the environment (<a href="https://docs.civicrm.org/sysadmin/en/latest/misc/staging-production/#changing-your-environment" rel="nofollow noreferrer">https://docs.civicrm.org/sysadmin/en/latest/misc/staging-production/#changing-your-environment</a>), but that doesn't clearly state what actually gets disabled (besides mail jobs). </p>
  
  <p>What is the best way to ensure that my test server has all that stuff disabled? I have several sites running on the server and need to do this from the command line.</p>
  
  <p>Thanks!</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-02-18T20:13:41.140Z
Comments.Text: How is the cron job set up? You should just be able to turn off the cron job. How to do that depends on the server setup.
Comments.UserDisplayName: Demerit
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-02-18T22:24:29.533Z
Comments.Text: set Outbound Mail to go to the db?
Comments.UserDisplayName: petednz - fuzion
Tags: <civicontribute><recurring-contributions><scheduled-job><drush>
Title: Disabling Scheduled Jobs, Transactions, etc (from command line)?
ThreadText: # Disabling Scheduled Jobs, Transactions, etc (from command line)?
  
  (Asked by: username_0 on 2020-02-18)
  
  I'm working on migrating our site to a different server. I need to do some testing on the new server while keeping the production site live. The problem is that the test server continues to run all the scheduled jobs and recurring contributions. I read about changing the environment (<https://docs.civicrm.org/sysadmin/en/latest/misc/staging-production/#changing-your-environment>), but that doesn't clearly state what actually gets disabled (besides mail jobs).
  
  What is the best way to ensure that my test server has all that stuff disabled? I have several sites running on the server and need to do this from the command line.
  
  Thanks!
  
  **Tags:** civicontribute, recurring-contributions, scheduled-job, drush
  
  > **Comments:**
  > **username_1**: How is the cron job set up? You should just be able to turn off the cron job. How to do that depends on the server setup.  
  > **username_2**: set Outbound Mail to go to the db?  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_3 on 2020-02-19. Score: 1 | Accepted answer
  
  Setting the environment to Staging/Development will turn off all schedule job from running unless you explicitly specify runInNonProductionEnvironment=TRUE in job parameter and also no emails will be send out from CiviCRM to any contact(will be logged in a file on server disk)
  You can set the option to Staging/Development using one of the below methods
  
  CiviCRM >> Administer >> Debugging and Error Handling, Select option for 'Environment'
  cv api Setting.create environment="Staging" 
  drush cvapi Setting.create environment="Staging" 
  Over-ride settings by adding below lines in civicrm.settings.php
  
  :
  global $civicrm_setting
  $civicrm_setting['domain']['environment'] = 'Production';
  define( 'CIVICRM_MAIL_LOG', '/Users/pradeep/Sites/drupal7/sites/default/files/civicrm/templates_c//mail.log');
  
  > **Comments:**
  > **username_0**: Fantastic, thanks! The drush command is exactly what I needed.  
  
  ---
  
  