1

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!

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

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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