In restore.php, I believe that we should not trigger the restore process by setting values in the $_POST superglobal and then calling the restore_ui. I believe there is an API allowing to achieve the same via standard restore API code.
Places like https://docs.moodle.org/dev/Restore_2.0_for_developers or https://github.com/mudrd8mz/moodle-toolbox/blob/master/mbz/mbz-restorecourses.php may give you some hints on how to use the restore_controller without UI involved.
In restore.php, I believe that we should not trigger the restore process by setting values in the
$_POSTsuperglobal and then calling therestore_ui. I believe there is an API allowing to achieve the same via standard restore API code.Places like https://docs.moodle.org/dev/Restore_2.0_for_developers or https://github.com/mudrd8mz/moodle-toolbox/blob/master/mbz/mbz-restorecourses.php may give you some hints on how to use the
restore_controllerwithout UI involved.