Old Certificate vs Moodle 4 sideways-migration?

Old Certificate vs Moodle 4 sideways-migration?

Mike Howell發表於
Number of replies: 9
Hello Certificate users and devs,

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
評比平均分數: -
In reply to Mike Howell

Re: Old Certificate vs Moodle 4 sideways-migration?

Leon Stringer發表於
Core developers的相片 Particularly helpful Moodlers的相片

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.

In reply to Leon Stringer

Re: Old Certificate vs Moodle 4 sideways-migration?

Mike Howell發表於
Hi Leon,

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"

The cert seems to download, and maybe that's good enough.  But I don't know what those deprecation message mean from a practical standpoint (ie are features missing?).   More importantly the messages display to the users.  If the actual errors aren't going to be impactful, we will try to suppress.

What would be the "by hand" process for moving the certs over?  I'm not familiar with the certificate process, but I wonder if I could write a custom ETL.

Thank you!!
In reply to Mike Howell

Re: Old Certificate vs Moodle 4 sideways-migration?

Mark Nelson發表於
Core developers的相片 Documentation writers的相片 Particularly helpful Moodlers的相片 Peer reviewers的相片 Plugin developers的相片 Testers的相片
https://moodle.org/mod/forum/discuss.php?d=353118 for the reason you can't simply update to the "new" one.

Looks like those messages are caused by Moodle as the function responsible exists solely to "plug in" with Moodle and uses those variables.
In reply to Mark Nelson

Re: Old Certificate vs Moodle 4 sideways-migration?

Mark Nelson發表於
Core developers的相片 Documentation writers的相片 Particularly helpful Moodlers的相片 Peer reviewers的相片 Plugin developers的相片 Testers的相片
In reply to Mark Nelson

Re: Old Certificate vs Moodle 4 sideways-migration?

Mike Howell發表於
I take it to mean edit the affected certificate/locallib.php file in the same manner as the patch. I'll give it a try and report back.
In reply to Mike Howell

Re: Old Certificate vs Moodle 4 sideways-migration?

Mike Howell發表於
I think I'm actually seeing 2 different issues. The messages in the nginx log went away after I edited the locallib.php file. But the user reports the messages on-screen are still present. I can confirm however the on-screen messages can be suppressed if I turn debugging off in config.php. This may be the way forward. But for grins, here's what I have:

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()
In reply to Mike Howell

Re: Old Certificate vs Moodle 4 sideways-migration?

Kate Rhodes發表於
Mike did you ever get this to work? We have the same issue with one old certificate we are trying to keep on our Moodle for now. Just wondering if you figured out how to edit the file?
In reply to Mark Nelson

Re: Old Certificate vs Moodle 4 sideways-migration?

Mike Howell發表於
"you can't simply update to the "new" one"

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.
In reply to Mike Howell

Re: Old Certificate vs Moodle 4 sideways-migration?

Mark Nelson發表於
Core developers的相片 Documentation writers的相片 Particularly helpful Moodlers的相片 Peer reviewers的相片 Plugin developers的相片 Testers的相片
It's not possible. The old one was generated by someone programming where things should go, the "new" one lets you drag and drop and stores this information in the database rather than the PHP file.