Commit Graph

22 Commits

Author SHA1 Message Date
Cameron Ball 29df52af19 MDL-74548 backup: Refactor course copies
This patch modifies the way copy data is shared in order to mitigate potential race conditions
and ensure that the serialised controller stored in the DB is always in a valid state.

The restore controller is now considered the "source of truth" for all information about the
copy operation. Backup controllers can no longer contain information about course copies.

As copy creation is not atomic, it is still possible for copy controllers to become orphaned or
exist in an invalid state. To mitigate this the backup cleanup task has been modified to call
a new helper method copy_helper::cleanup_orphaned_copy_controllers.

Summary of changes in this patch:

    - Copy data must now be passed through the restore controller's constructor
    - base_controller::get_copy has been deprecated in favour of restore_controller::get_copy
    - base_controller::set_copy has been deprecated without replacement
    - core_backup\copy\copy has been deprecated, use copy_helper.class.php's copy_helper instead
    - backup_cleanup_task will now clean up orphaned controllers from copy operations that went awry

Thanks to Peter Burnett for assiting with testing this patch.
2022-06-29 09:13:29 +08:00
Matt Porritt 2cd901a4e7 MDL-28505 Backup: Asynchronous backup and restore
This patch adds asynchronous backup and restore functionality
to Moodle. This is an optional feature and is not enabled by
default. It can be enabled by site administrators.
Asynchronous backup and restores are actioned by the Moodle
adhoc task API. The progress of backup and restores is
displayedin the Moodle UI.  Users can also be sent a message
when a backup or restore operation completes via the
Moodle messaging API.
2019-04-09 00:15:42 +00:00
James Pratt 809fdb83b1 MDL-41754 (1) Progress tracking : moved from backup and restore to core 2014-01-27 17:45:50 +07:00
sam marshall 77b3d9dfdf MDL-38196 Backup/restore: Display log if non-empty
When doing a backup or restore operation with the normal user interface,
if there is anything in the backup/restore log, it will now be displayed
at the end of the process below the Continue button.

If you have developer debugging enabled, it sets the display level to
LOG_DEBUG and there will always be content in the log. Otherwise, it
uses LOG_INFO which generally means the log is empty, and nothing
displays (no visible change for users).
2013-10-08 11:00:11 +01:00
sam marshall a7a64d774a MDL-41253 Restore: Mechanism to display progress during UI stages 2013-09-09 12:42:07 +01:00
sam marshall f06abc2ac1 MDL-38190 (3) Backup/restore: Progress display in main user interface 2013-08-16 16:28:04 +01:00
sam marshall 16cd708835 MDL-38190 (1) Backup/restore: Progress tracking API 2013-08-16 10:50:35 +01:00
Davo Smith f5744d1cfa MDL-31484 backup - repeated restores with anonymised users now works correctly 2012-11-29 19:57:16 +00:00
Eloy Lafuente 0f66acede0 MDL-22135 - logs restore, course and activities + cleanup 2010-11-11 19:46:04 +00:00
Eloy Lafuente 08edad78cc MDL-22138 backup - added missing required lib 2010-10-24 15:37:55 +00:00
Eloy Lafuente 41941110fd MDL-22138 backup - I know smaller cathedrals than this, yay quizzes! 2010-10-24 10:43:42 +00:00
Sam Hemelryk fe213bc056 NOBUG: Added missing include within restore 2010-09-21 05:47:32 +00:00
Eloy Lafuente bad08e7f0f MDL-21432 backup - need course/lib to rebuild course cache. 2010-07-27 23:42:00 +00:00
Eloy Lafuente aae0d2fad0 MDL-21432 backup - need to acces gradelib API on restore 2010-07-27 23:15:09 +00:00
Eloy Lafuente 5b457d2657 MDL-22179 backup - final implementation of the interlinks decoder for restore 2010-07-27 14:45:44 +00:00
Sam Hemelryk 3acc9b81f5 restore MDL-23109 Added role mapping interface and implemented searchable course/category selectors 2010-07-27 06:58:39 +00:00
Sam Hemelryk 785d6603dd backup MDL-23109 Implemented base restore UI within Moodle and linked through the navigation. 2010-07-22 07:48:02 +00:00
Eloy Lafuente 71a50b133d MDL-21432 - backup finished groupings restore + introduced role precheck/execution step 2010-07-19 14:06:16 +00:00
Eloy Lafuente c3ea499d53 MDL-21432 backup - handle mnet_remoteusers and support for prechecks 2010-07-18 23:49:55 +00:00
Eloy Lafuente 2df0f295b4 MDL-21432 backup - file handling and other changes. Saving before changes tomorrow due to MySQL temp tables limits 2010-07-18 01:35:18 +00:00
Eloy Lafuente 482aac657a MDL-21432 backup - root task, inforef and users handling completed, various fixes 2010-07-14 23:59:19 +00:00
Eloy Lafuente fbc2778d1c MDL-21432 backup - rest of helper files 2010-07-06 22:35:02 +00:00