Hmmm .... csv routine not working. Wonder if code restricts?
I see the idnumber is what you want in shortname.
Couldn't that be done via MySQL client?
| shortname | varchar(255) | NO | MUL
| idnumber | varchar(100) | NO | MUL
UPDATE mdl_course SET idnumber=shortname where shortname='X';
where X above is a shortname.
Try that with just one row ... then see change via mysql client:
select fullname,shortname,idnumber from mdl_course where idnumber='m341';
Query above had
Moodle Sharing | MSHARE | MSHARE
Originally ... I then changed idnumber to m341 on test system.
and check via Moodle interface.
You could tinker with mysql client commands with a copy of your production DB re-imported to another DB name on same DB server.
Then find a way to loop through the shortnames and set idnumber to same.
'SoS', Ken