Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-79564

Implement import CLI script

XMLWordPrintable

    • MOODLE_401_STABLE, MOODLE_402_STABLE
    • MOODLE_404_STABLE
    • MDL-79564_master_v2
    • Hide

      1. Create a test course "Test course" from Site administration > Development > Make test course.
      2. Create a course "Course for restore" and note id of the course.
      3. Open any activity in the "Test course" and note id of the course module.
      4. Open console and run the command: (parameter X is cmid from 3, and parameter Y is course id from 2.)

      php admin/cli/import.php --srccmid=X --dstcourseid=Y

      5. Confirm, the output looks like:

      == Import from cmid:2 into course:5 ==
      == Backup completed. Start to restore. ==
      == Restored course ID: 5 ==

      6. Confirm the course module is imported to "Course for restore".

       

      Show
      1. Create a test course "Test course" from Site administration > Development > Make test course. 2. Create a course "Course for restore" and note id of the course. 3. Open any activity in the "Test course" and note id of the course module. 4. Open console and run the command: (parameter X is cmid from 3, and parameter Y is course id from 2.) php admin/cli/ import .php --srccmid=X --dstcourseid=Y 5. Confirm , the output looks like: == Import from cmid: 2 into course: 5 == == Backup completed. Start to restore. == == Restored course ID: 5 == 6. Confirm the course module is imported to "Course for restore".  

      There are backup and restore CLI, but not for import.

      It's good to have the CLI script for import.

            tomotsuyuki Tomo Tsuyuki
            tomotsuyuki Tomo Tsuyuki
            Guillaume BARAT Guillaume BARAT
            Ilya Tregubov Ilya Tregubov
            Ron Carl Alfon Yu Ron Carl Alfon Yu
            Votes:
            0 Vote for this issue
            Watchers:
            23 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 3 hours, 21 minutes
                3h 21m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.