Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

General database mover class

Copyright: 2008 Andrei Bautu
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 122 lines (5 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: database_mover  - X-Ref

__construct(moodle_database $mdb_source, moodle_database $mdb_target,$check_schema = true, progress_trace $feedback = null)   X-Ref
Object constructor.

param: moodle_database $mdb_source Connection to the source database (a
param: moodle_database $mdb_target Connection to the target database (a
param: boolean $check_schema - whether or not to check that XML database
param: progress_trace $feedback Progress tracing object

set_transaction_mode($mode)   X-Ref
How to use transactions during the transfer.

param: string $mode 'pertable', 'allinone' or 'none'.

begin_database_export($version, $release, $timestamp, $description)   X-Ref
Callback function. Calls importer's begin_database_import callback method.

param: float $version the version of the system which generating the data
param: string $release moodle release info
param: string $timestamp the timestamp of the data (in ISO 8601) format.
param: string $description a user description of the data.
return: void

begin_table_export(xmldb_table $table)   X-Ref
Callback function. Calls importer's begin_table_import callback method.

param: xmldb_table $table - XMLDB object for the exported table
return: void

export_table_data(xmldb_table $table, $data)   X-Ref
Callback function. Calls importer's import_table_data callback method.

param: xmldb_table $table - XMLDB object of the table from which data
param: object $data - data object (fields and values from record)
return: void

finish_table_export(xmldb_table $table)   X-Ref
Callback function. Calls importer's finish_table_import callback method.

param: xmldb_table $table - XMLDB object for the exported table
return: void

finish_database_export()   X-Ref
Callback function. Calls importer's finish_database_import callback method.

return: void