Moving Lesson to another course

Moving Lesson to another course

by Cynthia Steck -
Number of replies: 10

I'm hoping that someone can help me.  I have two lessons that have been setup on the main page of Moodle and not a part of any course.  I would like to move them both under a specific course that has been created as new topics.  Is there a SQL script that I can run to take care of this?  I have tried to backup and restore, and then the import but I haven't had any luck.  Please advise.

Average of ratings: -
In reply to Cynthia Steck

Re: Moving Lesson to another course

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Cynthia > I have tried to backup and restore, and then the import but I haven't had any luck.
This is not a matter of good or bad luck. What exactly happens when you try a backup and restore of those lessons? Any error messages displayed?
Joseph
In reply to Joseph Rézeau

Re: Moving Lesson to another course

by Cynthia Steck -

When I try to backup and restore, I save the backup to the default directory per the instructions that have been posted on the forums.  I created a new course and tried to restore the backup to the new course.  But when I go to browse to load the backup file there is a backup folder and no other files.  I don't receive any messages.  I just don't think it's backing up the main page.  There are 2 lessons that were created on the main page that I can not backup and restore or import because they are not listed under a course.  I looked at the data structure in the database.  It would seem that you should be able to run a SQL script to 'assign' a lesson to a specific course.  When I played with the indexes a bit, I was able to move the lessons off the main page but couldn't get them to show up under the correct course.

Please help.

Thanks,

Cynthia Steck

In reply to Cynthia Steck

Re: Moving Lesson to another course

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Step-by-step.
On your Moodle site front page you have Lesson01 and Lesson02.
On your Moodle site you have Courses A, B, C, ...
You want to backup Lessons01 and 02 and restore them to e.g. Course A.
  1. On your Moodle site front page, go to Site Administration, Front page, Front page backup and click.
  2. On the Course backup: page, only select Include:Lessons Lessons01 and Lesson 02 (no User Data)
  3. Next page message says: "Backup Details: Include Lessons without user data Lesson 01 Lesson 02". Click Continue.
  4. Next page message (bottom) says "Backup completed successfully". Click Continue.
  5. Next page Administration Front Page Front Page restore. In the list of saved backups (Name Size Modified Action) spot the recently saved file (something like File backup-moodle19dev-20080318-1528.zip 2.2KB 18 Mar 2008, 03:32 PM. Click on the name of the zip file and save to disk on your local computer (remember where you save it for further use).
  6. On your Moodle site, go to Course A. Go to Administration/Restore.
  7. On the ► CF101 ► Files ► backupdata page, click the Upload a File button. Navigate to the place where you just saved the zipped file e.g. backup-moodle19dev-20080318-1528.zip and upload this file to the backupdata folder of Course A.
  8. When this is done, in the Action column click on the Restore link in the row corresponding to e.g. the backup-moodle19dev-20080318-1528.zip file.
  9. Top message: "You are about to start the restore process for:" etc. Do you want to continue? Click Yes.
  10. Next page: Course restore backup-moodle19dev-20080318-1528.zip. Click Continue.
  11. Top message: Restore to: Select: Existing course, adding data to it and click Continue
  12. Next page: Choose a course : select Course A from the list of existing courses.
  13. Next page:Please note that this process can take a long time. Click the Restore this course now! button.
  14. Next message: Restore completed successfully. Click Continue.
  15. Et voila! in only 14 easy steps.wink
Average of ratings: Useful (1)
In reply to Joseph Rézeau

Re: Moving Lesson to another course

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Cynthia,
In your original post you mentioned you wanted to move those lessons from front page to a course. When you have gone through the 14 steps in my previous post, you'll still have to delete the original 2 lessons from the front page, of course.
Joseph
In reply to Joseph Rézeau

Re: Moving Lesson to another course

by Cynthia Steck -
Thanks for all your help. Your instructions are very detailed, however, I can't get past step 1.  I am using Moodle 1.7.1 if that helps.  Under Site Adminstration the only place there is an option for Front Page is under Appearance.  When I click on that, I don't have any options to backup.  Now I'm totally lost.  Please help.
In reply to Cynthia Steck

Re: Moving Lesson to another course

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Oops! First thing you should have said is the Moodle version you are using. Things move fast, and I have not used Moodle 1.7 for more than a year now. Sorry. Why not upgrade to 1.8 or 1.9? Version 1.7 never was a good version anyway.
Joseph
In reply to Joseph Rézeau

Re: Moving Lesson to another course

by Cynthia Steck -

Unfortunately, I don't have the option of upgrading the framework for a couple of months at this point.  The user that had setup the course on the front page and needed it moved has since manually added it where it belongs it the other course.  Thanks for everyones help, and I have the backup restore instructions you have given for the next time this happens.

Thanks for everyone's hard work and advice!

Cynthia

In reply to Cynthia Steck

Re: Moving Lesson to another course

by Chris Collman -
Picture of Documentation writers
Hi Cynthia,
Could you get the lesson to show up in any course? Do a backup on it? I think I have a localhost that is 1.7 here at work. I will give it a shot and report back here.

I am playing around with the automatic backup settings in the Admin block. I don't know how to back up the front page, but I see something about courses. Wondering if I can set it to back up to a different directory. It is set to run in another 5 minutes, so we will see.

I am wondering if you can fool it via the file structure? Create a new course and a short lesson. Then copy the contents of the Lesson folder from the front page area to the contents of the Lesson folder in the new course? Probably will break it smile

The job should have run. So I will be back in a bit.





Best Chris
In reply to Cynthia Steck

Re: Moving Lesson to another course

by Chris Collman -
Picture of Documentation writers
Hi Cynthia,
Over in the backup forum, Steve had this. My version of 1.7 seems corrupted. I get a backup error in a couple of course that already exist and in the new front page course I created. But the backup screen does come up. It does create a zip file that I can find.

I've never actually used 1.7....tried it once and it was a disaster. So, this is just "theory" based on what I can do in 1.6...maybe it'll work for you.

1. Log in as Admin

2. Go into any course

3. Click the backup link as if you were going to backup that course

4. Look at the url and you will see a number at the end

5. Change that number to 1

6. Press the Enter key and you should now see that you are backing up the frontpage of your site (course 1)

Do the rest as normal.

Steve


In reply to Cynthia Steck

Re: Moving Lesson to another course

by Chris Collman -
Picture of Documentation writers
Hi Cynthia,
Yep, Steve's method works. My old 1.7 localhost was corrupted. I created a new 1.7.4 Moodle. Put topics on the FrontPage. Created a 2 page lesson on the front page. Created a simple course. Went to the simple course and clicked on the backup, changed the id to 1.

I immediately clicked on the restore button, told it to put it in a new course. Presto. Looks like it would also work for another activity or resource placed in a topic on the front page.

Best Chris