PHP Developer / Moodle Developer

PHP Moodle Developer
About me I'm PHP developer with 13 years of experience. I've prepared Moodle/Totara custom development for last 5 years. I built my first software when I was 9 years old. Welcome to my site!

Częstochowa, Poland
+48 668 690 844

Programmatic backup of course activity

Back to Moodle code tips

# backup course

Here is the code (tested on Totara 2.9):


// The backup fill be stored in the $CFG->dataroot/temp/backup folder.
$CFG->keeptempdirectoriesonbackup = true;

require_once($CFG->dirroot . '/backup/util/includes/backup_includes.php');

$course_module_to_backup = 11; // Set this to one existing choice cmid in your dev site
$user_doing_the_backup = $USER->id; // Set this to the id of your admin accouun

$bc = new \backup_controller(\backup::TYPE_1ACTIVITY, $course_module_to_backup, \backup::FORMAT_MOODLE,
\backup::INTERACTIVE_NO, \backup::MODE_GENERAL, $user_doing_the_backup);

Back to Moodle code tips
PHP Moodle Developer
I'm offering wide range of development for your Moodle / Totara LMS system. As a Moodle developer I can prepare for you fency dashboards, new blocks, new local plugins, report builder custom sources and other types of plugins. I can extend default Moodle / Totara functionality according to your ideas and needs. Because I have strong experience in general PHP field I can implement an application from scratch using any modern framework like Laravel or Phalcon -- Bartosz Hornik, PHP Moodle developer.