I need help understanding the recommended approach for disabling a backup on a testing or development environment. Is there a simple variable setting I can include in my settings.php (or template.php) to disable one or more schedules?
With version 7.x-2.x, I was creating all my schedules and destinations and profiles entirely via settings.php, following a method similar to that described by aklata here:
Add ability to enable/disable backup scheduling in settings.php
Using this approach, I wouldn't have any backup profiles or schedules saved in the database on my production site, and would store them all in the settings.php file. Then I simply didn't include those settings on my development/testing/staging sites.
I understand that with 7.x-3.x, that is no longer the recommended approach. So now I've got an exported template that I can use to quickly import a standard backup scheme into any site (cool!). But since that schedule now lives in the database, I'd like an easy way to disable the backups on my other environments, so that I can bring a database over from the live site without manually disabling the scheduled backups after I do so.
I gather Features would help with this, but it looks like all it needs now is a simple variable edit somewhere ('enabled' => '0'). But where?
Alternatively, I would welcome helpful advice on a better approach to achieving the same thing with 7.x-3.x.
Comments
Comment #1
ronan CreditAttribution: ronan commentedThat method still works in the 3.x version. You can export the schedule and simply add:
to your settings.php
I hope this helps. Let me know if it doesn't work.
Comment #2
ronan CreditAttribution: ronan commentedIt should be noted, that any changes you make to the DB will override the defaults in settings.php. So you may need to delete the shedule from your database (it should be labeled 'revert') after you export.
Comment #3
pkiff CreditAttribution: pkiff commentedGreat! Thanks, ronan. I got it working now.
I wasn't quite sure how to connect the new fields up with the right schedules since my old settings.php backup_migrate code from 7.x-2.x produced errors.
For others who might be looking to do this, here is a sample backup variable config from a production environment settings.php file running backup_migrate 7.x-3.x.
Comment #4
peterpearson CreditAttribution: peterpearson commentedThanks for the example. I'd also suggest the current Drupal version is available on the VERSION constant in settings.php. It would seem safer to use that than trust $drupal_version gets updated manually.