Commit Graph

155 Commits

Author SHA1 Message Date
Mark Nelson
2124100194 MDL-35773 core_backup: ensure we restore with new itemid 2019-07-26 11:59:57 +08:00
Mark Nelson
94c71056a3 MDL-35773 core_backup: use existing API to recover files 2019-07-26 11:59:56 +08:00
Matt Porritt
d7e4481e98 MDL-35773 Backup: API should have option to not backup files
Allow both UI and automated backups to be created without
including files.  Instead include only file references.
This is essentially implementing "SAMESITE" to backup files
instead of only for import and export functionality.
A new backup setting to include files (defaults to yes)
has been included.

The restore process will also look for and attempt to
restore files from the trashdir as part of restoring
backups.  Additionally to support this process the
ammount of time files are kept in trashdir before they
are cleaned up via cron is also adjustable via admin
setting.
2019-07-26 11:59:56 +08:00
David Monllaó
e034670fac Merge branch 'MDL-62572-master' of git://github.com/damyon/moodle 2019-04-15 11:04:54 +02:00
Damyon Wiese
f10c22b691 MDL-62572 backup: Duplicating an activity
Don't apply admin defaults for import when using the duplicate function.
2019-04-12 14:04:40 +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
Shamim Rezaie
30dd3c5d0f MDL-62897 restore: Fix component name in get_string() 2018-07-23 14:37:40 +10:00
Tim Hunt
3511063252 MDL-45851 restore: random questions must always be created
They are really a pointer from a particular quiz to a question category.
They should never be shared, because if they are, unexpected things
happend when they are edited.
2018-07-04 16:33:30 +01:00
Shamim Rezaie
8df402e401 MDL-61132 Questions: Adapt logic on backup/restore
Modifying backup/restore to adapt with "Top" categories.
2018-02-05 11:58:57 +11:00
Marina Glancy
44e86fb3d5 MDL-34859 backup: add restore defaults 2017-03-20 14:59:45 +08:00
Frederic Massart
3d3fb328b4 MDL-57063 backup: Do not try to set default value on locked setting
We cannot set a default value on settings which are 'config' or
'permission' locked or an exception will be thrown from
base_setting::set_value.
2016-11-21 11:03:41 +08:00
Jake Dallimore
3869d77411 MDL-54751 core_course: Edit course libs to support deletion flag
Changed the course libs such that module and section deletion is now
handed off to relevant functions in the util class and exempted
modules scheduled for deletion from the course backups.
2016-11-07 07:41:59 +08:00
Daniel Neis Araujo
fbcdb0d710 MDL-22078 course: add end date 2016-10-03 09:51:36 +08:00
Andrew Nicols
2fc56dd571 MDL-51361 backup: Documentation phpcs fix 2016-09-20 12:21:41 +08:00
Henning Bostelmann
4151ed984a MDL-51361 backup: Adding default settings for course import
Also adding "calendar events" and "competencies" default setting for other backup modes.
2016-09-18 23:39:57 +01:00
Neill Magill
31c62848f0 MDL-55617 backup: Possible fatal errors in backup and restore
The unserialize() function will not always return an object
especially when as can happen the controller field of a
record in the backup_controllers table is empty.

This change ensures that in this case the script will
not cause a fatal error, but instead throw an error.
2016-09-01 08:51:25 +01:00
Jake Dallimore
d8e73d61b9 MDL-55565 core_backup: Fix warning when restoring question categories
Fixed a call to get_records_sql, which was being used incorrectly in
restore_find_best_target_context to determine a unique contextid.
2016-08-18 10:15:51 +08:00
Eloy Lafuente (stronk7)
53f95c99cb MDL-54205 backup: loggers close() and destroy()
Any backup & restore operation may be leaving opened files
if a file logger is being used. This implementes the close()
method, so every logger can close any resource.

Also, the recommended backup_controlled::destroy() method
now calls to new logger::destroy() method in charge of
deleting all the references and closing any resource.

Finally, some internally used controllers, were missing
their destroy call, leading to associated loggers to
remain open. Now all them are explicitly deltroyed.
2016-05-13 01:54:28 +02:00
Dan Poltawski
04a03ff282 Merge branch 'wip-MDL-50851-master' of git://github.com/marinaglancy/moodle 2016-01-12 14:17:14 +00:00
Cameron Ball
088d6086d8 MDL-21912 restore: Add admin setting to restore conflicting admin user 2016-01-11 14:08:58 +08:00
Marina Glancy
c4e868d5f0 MDL-50851 user: use new tag API for interests 2016-01-10 15:25:47 +08:00
Damyon Wiese
51311962c4 MDL-46455 backup: Keep external database logstore code self-contained.
General backup/restore does not need to handle external data sources natively - so
any changes needed to achieve this should be contained to the plugin that needs it.
2015-10-09 16:23:09 -07:00
Mark Nelson
bcfa51ca41 MDL-46455 logstore_database: added backup/restore support 2015-10-09 16:23:09 -07:00
Tony Levi
303936aa57 MDL-50453 core: Replace reserved word usage in progress\null (PHP7) 2015-06-15 12:21:27 +09:30
Matt Sammarco
868b086c4a MDL-18177 backup: Add backup option to include groups and groupings 2015-02-20 11:45:22 +11:00
David Monllao
03c39daad8 MDL-31500 backup: Allow front page backup/restore
Removes restore on front page restrictions and allows
front page modules duplication.
2014-11-21 14:55:09 +08:00
Dan Poltawski
cb1bf3f51a Merge branch 'MDL-40228-master' of git://github.com/FMCorz/moodle 2014-06-30 08:55:35 +01:00
Eloy Lafuente (stronk7)
8b8c78946f Merge branch 'MDL-46079-master' of https://github.com/sammarshallou/moodle 2014-06-25 01:32:11 +02:00
sam marshall
9f7b688c63 MDL-46079 Restore: Can run out of memory in get_records call 2014-06-20 14:15:28 +01:00
Frederic Massart
073be367e2 MDL-40228 backup: Settings were ignored during automated backups 2014-06-20 15:37:32 +08:00
Russell Smith
d2c58b95bb MDL-43835 phpunit: Correct unit tests.
When different ID's are set for each sequence a number
of unit test failures appear.  They have been corrected
to allow unit tests to pass with the new generator in place.
2014-06-17 19:08:01 +10:00
sam marshall
e974eef932 MDL-45574 Backup progress: Can time out with large number of files
When there are many files inside a single resource, it's possible
for the backup to time out because it does not report progress
while adding entries to the backup_ids table.
2014-06-06 10:41:40 +01:00
Ankit Agarwal
a9282e4120 MDL-45258 tags:context object/0 should not be passed to tag_set() 2014-04-28 15:35:01 +08:00
Mark Nelson
cc033d48b5 MDL-44316 core_tag: changed the API to accept a contextid and component 2014-03-22 13:50:08 -07:00
Dan Marsden
538864dffd MDL-44066 Restore: Restore source field.
Causes problems when restoring a SCORM pacakge that uses an alias.
2014-03-08 21:09:30 +13:00
James Pratt
809fdb83b1 MDL-41754 (1) Progress tracking : moved from backup and restore to core 2014-01-27 17:45:50 +07:00
Petr Škoda
2803f3c1b5 MDL-43402 remove all zlib detection code
Zlib extension is now required.
2013-12-27 11:06:18 +08:00
sam marshall
40e8f0260c MDL-42815 Backup/restore: Error saving files - log messages unhelpful
This commit contains three changes in the three files:
1. A bug in the backup process meant that anything logged after a
   certain point did not appear in the on-screen display of the
   backup log, because the logger was serialised and deserialised
   but display code referred to the old version. Changed so that
   code retrieves new object.
2. Add more information to backup log when there is a missing file.
3. Add more information to restore log when there is a missing file
   (and remove existing code duplication of the current message).

The 'missing file' situation is one that generally shouldn't occur in
normal usage, but when it does happen, it is useful to have full
information about the file.
2013-11-11 17:15:32 +00:00
Damyon Wiese
3b4e5a83f4 Merge branch 'MDL-38734-master' of git://github.com/danpoltawski/moodle 2013-11-01 08:55:29 +08:00
Damyon Wiese
3a33578926 Merge branch 'wip-mdl-30812' of git://github.com/rajeshtaneja/moodle 2013-10-28 12:11:34 +08:00
Rajesh Taneja
0daadaaeaf MDL-34612 Restore: Gracefully handle empty file contenthash while restoring 2013-10-22 09:47:42 +08:00
sam marshall
b6cdb4d660 MDL-42389 Restore: Broken restore causes notice before exception 2013-10-18 12:00:56 +01:00
Tony Levi
1b55bdb644 MDL-38734: Automated backup failure causing all course to fail
Conflicts:
	backup/moodle2/backup_stepslib.php
2013-10-18 15:07:35 +08:00
sam marshall
0e2637054f MDL-42039 Restore: Add progress tracking while creating users
When restoring a backup that contains a large number of users
to a different server where those users don't already exist,
creating users can take a significant time. This change adds
progress reporting so that it doesn't time out and shows
activity in the user interface while doing the creation.
2013-10-10 10:57:31 +08:00
sam marshall
37ff843d7d MDL-42039 Restore: Add progress reporting between files in resource
When a resource contains a very large number of (presumably small)
files, we should display progress between each file so that it
doesn't time out.
2013-10-10 10:56:30 +08:00
Dan Poltawski
4f0eaf18f4 Merge branch 'MDL-40493-master' of git://github.com/damyon/moodle
Conflicts:
	lib/db/install.xml
	lib/db/upgrade.php
	version.php
2013-10-08 16:42:17 +08:00
sam marshall
e555a4439f MDL-41722 Backup: Very large course times out on user interface pages
Adds 'Preparing page display' progress bars for user interface pages
if they take a long time to display.

Also adds changes where other parts of the backup progress timed out on
long backups. After this change, and MDL-41838, it is finally possible on
my dev server to successfully back up the 'XL' test course.
2013-10-04 10:32:13 +01:00
Damyon Wiese
3d27180e94 MDL-40493 User preference: Allow users to set their preferred text editor.
This changes the setting htmleditor in the user table from a 0 or 1 column
to a user preference for the name of their preferred html editor.
2013-10-02 12:49:30 +08:00
Marina Glancy
9e11059326 Merge branch 'MDL-12403-master' of git://github.com/danpoltawski/moodle 2013-09-30 18:04:38 +10:00
Dan Poltawski
2d2489e59e MDL-12403 backup: prevent unset config from being applied 2013-09-26 09:55:13 +08:00