We are planning a sideways migration from our production Moodle 3.11 to a new Moodle 4 server.
In my efforts to set up the new Moodle 4 server, I downloaded and copied in the old Certificate plugin, but the installer threw up a number of errors where it wanted to downgrade or remove various components.
Is the old Certificate expected to function on Moodle 4? Are there steps to installing that are different from normal plugin installation?
If the old Certificate cannot be installed on Moodle 4, then is there a way to port all the old Certificates to the new Custom Certificate? We have thousands of old Certs, so it would be impossible to migrate or re-create these by hand.
Thanks,
Mike
I support a Moodle 4.1 site that still has the old certificate plugin and this seems to work okay. However this uses PHP 7.4 and I would anticipate problems with this when switching PHP 8.x.
I downloaded and copied in the old Certificate plugin, but the installer threw up a number of errors where it wanted to downgrade or remove various components.
If you share the errors we may be able to advise further.
…is there a way to port all the old Certificates to the new Custom Certificate? We have thousands of old Certs, so it would be impossible to migrate or re-create these by hand.
As far as I know this can only be done by hand.
Thank you so much for the reply--apologies for getting back to you so slowly.
I was able to copy the certificate folder from our 3.11 moodle/mod into the new 4.2.2 moodle/mod. The downgrade/remove warnings were a red herring. I allowed the install process to complete.
However, I think you're right that the difference between PHP7.4 and 8.x may be an issue. When fetching a cert for a course that was copied from our Moodle 3 environment, I see this in the nginx error log:
2023/11/27 12:07:50 [error] 1339#1339: *674 FastCGI sent in stderr: "PHP message: PHP Deprecated: Required parameter $groupmode follows optional parameter $sort in /opt/moodle/mod/certificate/locallib.php on line 392PHP message: PHP Deprecated: Required parameter $cm follows optional parameter $sort in /opt/moodle/mod/certificate/locallib.php on line 392PHP message: PHP Deprecated: Required parameter $style follows optional parameter $font in /opt/moodle/mod/certificate/locallib.php on line 1050PHP message: PHP Deprecated: Required parameter $text follows optional parameter $font in /opt/moodle/mod/certificate/locallib.php on line 1050" while reading response header from upstream, client: 172.16.3.131, server: our-new-moodle4-server, request: "GET /mod/certificate/view.php?id=2338909 HTTP/1.0", upstream: "fastcgi://127.0.0.1:9000", host: "our-new-moodle4-server", referrer: "https://our-new-moodle4-server/course/view.php?id=8413"
Looks like those messages are caused by Moodle as the function responsible exists solely to "plug in" with Moodle and uses those variables.
From https://ourmoodleserver/mod/certificate/view.php?id=5622129
get_extra_user_fields() is deprecated. Please use the \core_user\fields API instead.
line 3247 of /lib/deprecatedlib.php: call to debugging()
line 451 of /mod/certificate/locallib.php: call to get_extra_user_fields()
line 106 of /mod/certificate/view.php: call to certificate_get_issues()
user_picture::fields() is deprecated. Please use the \core_user\fields API instead.
line 255 of /lib/outputcomponents.php: call to debugging()
line 451 of /mod/certificate/locallib.php: call to user_picture::fields()
line 106 of /mod/certificate/view.php: call to certificate_get_issues()
What would be the by-hand way to copy/re-create those to the new custom cert? Would I be looking for custom files on the PHP server? I know we have not granted FTP access to it, so if there is custom PHP, only one of our developers would have uploaded it.