Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.

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.

return: void
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.

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

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

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

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

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

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

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

return: void