To anyone who wishes to use the Bulk Course Upload tool with Moodle 2.0. I am attaching a version that has been modified to make it work with 2.0. It works much like the version for 1.9 with some limitations. They are as follows:
1. The tool can no longer enrol teachers at the time of course creation. The process of enrolling a teacher in a course now involves several tables in the db in Moodle 2.0 and I wasn't able to make the necessary changes in the script. I have simply commented out the old portion if anyone wants to work with it. I did get it modified so that it inserts the correct information into mdl_role_assignments. The problem is that one other table needs to be modified for users to actually appear as enrolled teachers in a course.
2. Several of the fields that could be specified in 1.9 have been removed because they either no longer exist in the same table in 2.0 or because the insert wasn't working and I couldn't figure it out One example is adding topic heading to each week or section in a course.
3. There is a need to connect manually to the database. The values should be entered at the top of the script on line 78.
4. The script retains the insert functions from the 1.9 version but should, at some point, be upgraded to use the Moodle core functions. I was unable to do this due to my limited skills. Anyone who wants to work on this is welcome.
5. There are at least two other small 'bugs' that do not affect the functionality. One is an offset error and the other is a context error when attempting to output the header. I commented out the header output to get around that error and the offset error does not affect the functionality, as far as I can tell, and is only visible with debugging turned on....so I ignored it for now.
I think those are all of the issues/limitations. Othewise it does work in that it creates all of the courses fed to it through a cvs file and is thus a nice way to create a bunch of courses in a short amount of time. If you need to assign teachers, you can use the Upload Users tool (Site Administration -> Users -> Accounts -> Upload Users) to enroll teachers in courses. You can use the shortname from the file you used to create the courses. This adds one extra step but is still a fairly easy process compared to adding teachers one at a time. Of course, using the external database enrolment plugin is probaby a better option if you can set it up...
Experiment with this is a test environment to make sure it works as desired before you try it out on your production server.