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.


  • 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.
    – Demerit
    Commented Feb 18, 2020 at 20:13
  • set Outbound Mail to go to the db?
    – petednz - fuzion
    Commented Feb 18, 2020 at 22:24

1 Answer 1


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

  1. CiviCRM >> Administer >> Debugging and Error Handling, Select option for 'Environment'

  2. cv api Setting.create environment="Staging"

  3. drush cvapi Setting.create environment="Staging"

  4. 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');
  • Fantastic, thanks! The drush command is exactly what I needed.
    – Sleewok
    Commented Feb 20, 2020 at 17:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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