Problem restoring some courses from 1.9+ to 2.3

Problem restoring some courses from 1.9+ to 2.3

by Stephen Liseo -
Number of replies: 4

Hi All

We have started migrating our courses from out MOODLE 1.9+ system to 2.3. About Half the courses go accross fine but some are giving us problems. We are not recieving any errors but when we start the restore process and get to the SCHEMA all activities appear with the title $@NULL@$.

The 1.9 Server is using an MSSQL on a windows server and MOODLE is on a Liunux box. The problem is definatley at the 1.9 end because I cant even restore the courses back into the same server.

I have tried just backing up only a few elements of the course ie no activities or files etc, And that still doesnt work

I have tried replacing files that have the value $@NULL@$ with NULL (i read that here somewhere) I have tried cleaning the xml file with some tool recomended here. I am really at a loss and getting a lot of pressure from teachers so any assistance would be greatly appreciated.

Average of ratings: -
In reply to Stephen Liseo

Re: Problem restoring some courses from 1.9+ to 2.3

by Ken Task -
Picture of Particularly helpful Moodlers

Is the 1.9+ the highest version of 1.9.x+?  Normally that is recommended.  However, you say 1.9+ courses can't be restored even on the DB server box?

I see in the restore screen above that the Sections look out of order. 20, 21, 22, and then 12?  Wonder if the database tables on the MSSQL server are in need of repair?

Not setup the same way as you, so this is a suggestion (something to try) ... when one restores a 1.9 to a 2.x, Moodle 2 warns the backup zip is not a 'valid' 2 backup and that it will attempt to convert to a MDL 2 .mbz version first before restoring.

Following 'normal' restore options and choices is 'trouble' with any platform/DB.  So here goes ...

Let's say the 1.9 course is called as above '12MH Modern History'.  Start a *new* Moodle 2 course (no restore, yet) and give it minimal setup ... long name '12MH Modern History' short name '12MH' ... just enough to get by the initial form for creating a new course.  When you get to the step where that new course process is asking for you to enroll users ... *don't*.  Scroll down and in the left panel go to the course admin menu and click restore.  Use the 1.9.x backup file and choose the option to 'restore to this course' ... that's the blank one you have just setup.  That's very important/different.   Then step through the other screens.

In looking at  a 1.9.19+ backup that has been unzipped for inspection, the moodle.xml file (which you can open with notepad to inspect) has the following XML tag:

<IDNUMBER>$@NULL@$</IDNUMBER>

for all mods in the backup moodle.xml.

but that same section for a mod (resource if you will):

<ID>347</ID>
<TYPE>resource</TYPE>
 <INSTANCE>239</INSTANCE>

and another example:

      <MOD>
        <ID>240</ID>
        <MODTYPE>resource</MODTYPE>
        <NAME>Project Share Jing Capture</NAME>

In your screen shot, it appears the <NAME> tags aren't coming across.

BTW, the only thing I could find similar in tracker was from 2008 and for version 1.8.  Wasn't resolved back then either cause it couldn't be replicated.  This to say, you might have something 'unique' on your hands. sad

'spirit of sharing', Ken

In reply to Ken Task

Re: Problem restoring some courses from 1.9+ to 2.3

by Stephen Liseo -

HI Ken

Firstly thanks for taking the time for a such a detailed response.

The method you described for doing the restore is actually the way I have been doing the restore, But I have also tried every other possible variation as well.

Still getting the same result. This morning I tried again and this time the only element of the original course I backed up was the Labels, I unticked everything else, users, files, activities etc. I still got the same result

I have attached the moodle.xml file (ziped because the original is 120K)

If anyone can help decipher this it would be greatly appreciated.

Stephen

In reply to Stephen Liseo

Re: Problem restoring some courses from 1.9+ to 2.3

by Ken Task -
Picture of Particularly helpful Moodlers

What I did ….

unzipped it.

Edited the moodle.xml file from the command line: nano editor.
(could have done it with TextEdit but wanted to see errant characters)

In the moodle.xml file … findings:

Roles and overrides are included in the xml.

Consider backing up without any users (they won't xfer anyway) AND no roles … all un-checked.

Approximately 2200 lines in the XML dealt with roles and overrides.

In your 1.9 site, put the 12MH - Modern History 2 Unit course at the top level of the site (in categories).

In the 1.9 course before you backup, remove all blocks - those that can be turned off but turned on again in the blocks menu of the 1.9.

You also have OU Blog in the 1.9.  Got OU Blog in the 2?

In the summary for the course, what looks to be copied and pasted code from Office stuff.  Delete summary and retype it using nothing but Moodle … no copy and paste from anything else.  Don't worry about formatting in the 1.9 - no bold, no center, no fancy font ... etc. 

Get the course restored then do the re-formatting.

Ampersand stuff like (spaces added so you can see here):
& l t ; strong & g t; & l t ; u & g t ; & l t ; font size= & quot ;5 & quot ; & gt ;

Normally that stuff doesn't affect things, but in this case might be the culprit as just one errant ampersand thing can render the rest of the site (and maybe in this case, the restore from the backup) useless.

The same applies for sections.
Course Documents & Assessment Tasks
World War One, 1914-1919
War on the Western Front
The Home Fronts in Britain and Germany
Turning Points

Some summaries have only HTML code (hidden to normal viewing) and no text.
Section 6

There's a questionnaire in the XML.  Do you have questionnaire for version 2 installed on the 2 server?

Restored the edited/rezipped backup into a 1.9.19+.
Course restored … no issues but formatting in those that I did not completely remove the ampersand stuff.

Changed the layout of the course there.  Turned off all blocks.
Made a backup.

Restored to a 2.3 (no work around restore … just straight restore)
http://sos.tcea.org/moodle23/course/view.php?id=8158
Guest access allowed so you can see.

Summary: lots of 'scrubbing' to do in the 1.9 course FIRST.  Guess you don't want to update the current 1.9 to the highest 1.9.19+ first so 'scrubbing' is the only way you can do it.

'spirit of sharing', Ken

In reply to Ken Task

Re: Problem restoring some courses from 1.9+ to 2.3

by Stephen Liseo -

Wow what a great effort. Many, many thanks.

I was sure that I did not back up users when I did that backup, so I just tried it again and double , tripple cheked that users and roles are definatley unchecked, yet the backup file is still full of that data.

Anyway, I will get to work on the suugestions you have made andd see how I go.

Thanks Again

 

Stephen