Cahnging course start date in bulk

Cahnging course start date in bulk

by m question -
Number of replies: 3

Hi :D,

is there a way to change the course start date in bulk.

I used external database enrolment which created the courses, but the start date is not correct (I know each instructor can change it but it is required that alldate must be corrected),


Moodle 2.7

thanks


Average of ratings: -
In reply to m question

Re: Cahnging course start date in bulk

by Colin Fraser -
Picture of Documentation writers Picture of Testers

IF you have access to the database, you can change it using phpMyAdmin, or equivalent tool in your database operation. phpPgAdmin for PostgreSQL, or whatever. You will have to do it manually, I do not think there is an automatic or bulk way of doing this. 

If using phpMyAdmin, or similar, you can generate a Query UPDATE statement that will update all the courses start date to the required date - all you need do is find the right table. For example,  opne one courese and set the atart date to the right start date. Go to the mdl_courses table and find that course. Copy the start date in its format and the write a Update statement that reads something like: 

UPDATE `moodledb`.`mdl_course` SET `startdate` = '1441031400' WHERE `mdl_course`.`id` = *;

Assuming the * char will be for all courses. The startdate above is 1 September 2015, but you can reset it for anything. 

Average of ratings: Useful (1)
In reply to Colin Fraser

Re: Cahnging course start date in bulk

by m question -
Thank you so much , you helped me
I used phpmyadmin and the date should not be between apostrophe , it gave me error.
also I omit the where clause since I want to change all courses

Thanks
In reply to m question

Re: Cahnging course start date in bulk

by Colin Fraser -
Picture of Documentation writers Picture of Testers

Well done, sometimes it is trial and error.... or rather, knowing a bit more about writing SQL than what I have forgotten... duh!