by Tim Hunt.
Databases are good at that sort of thing. For example
SELECT cs.*, u.idnumber
FROM mdl_completion_status cs
JOIN mdl_user u ON u.id = cs.userid
Use that sort of query as the basis of what you ship to the other system.
You may also want to do similar things for other values, like mdl_course.id -> mdl_course.shortname, and turning contextid into something meaningful.