People have been asking for exporting all possible records of a database activity as a CSV file since one year. "All possible records" are all records from field types other than "file" or "picture". Dan Poltawski finally submitted this patch yesterday at
MDL-8407. I have re-submitted it including some bugfixes recently, as " MDL-8407-20080419.patch", which works fine against the latest Moodle 1.9+.
The patch attached here allows you to use the exported CSV file to be used to import all the records. The current implementation failed to import some fields, such as multimenu and latlong.
In addition, the import process should be less resource eating, since it avoids to read files that are not necessary and does not create mega-objects such like $currentfield. During the import process, there is output written to the browser what has actually been done.