Upgrade went horribly wrong!

Upgrade went horribly wrong!

by Lars Lundstrom -
Number of replies: 7

Hi,

Can anyone help me, I've got an upgraded file system but an old database!!

This is what happened, we wanted to upgrade from 1.9 to 2.x so I installed a new ubuntu server with my sql and a new ubuntu server with moodle 1.9 so that we would be able to upgrade without messing with the production environment. Moodledata is on an nfs-share on another ubuntu server.

Without thinking very much, obviously, I mounted the production nfs share on the test server and ran the upgrade. I got an email from the guy in charge telling me not to do any upgrades and immediately drop the upgraded database on the new sql server which I did and now I'm stuck with an old database and the new file structure! The old moodle server doesn't recognize the new file system and the new test environment doesn't wanna play ball, I've tried to upgrade again but it's stuck at "Migrated blog attachments 100%".

Average of ratings: -
In reply to Lars Lundstrom

Re: Upgrade went horribly wrong!

by Guillermo Madero -

So the upgrade changed the db and moodledata folder at the production, and then the original db was restored. Couldn't he use a moodledata backup to restore it also?

 

In reply to Guillermo Madero

Re: Upgrade went horribly wrong!

by Jon Witts -
Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

Let's hope they have that backup!

In reply to Jon Witts

Re: Upgrade went horribly wrong!

by Guillermo Madero -

Rule number one!!

In reply to Guillermo Madero

Svar: Re: Upgrade went horribly wrong!

by Lars Lundstrom -

Thanks for all the hindsight! We managed to finish the upgrade. Now, when we look at the files table in the moodle database we see the correct hashes matching the file names under moodledata/filedir/something.something but still we can't access the old files, when we try we get something like "this legacy type of file has yet to be migrated". Any ideas?

In reply to Lars Lundstrom

Re: Svar: Re: Upgrade went horribly wrong!

by Ken Task -
Picture of Particularly helpful Moodlers

If one were to query the DB with:

select * from mdl_files where filearea = "legacy" and status="0"

would it find those files it says hasn't been migrated yet?

'spirit of sharing', Ken

In reply to Ken Task

Svar: Re: Svar: Re: Upgrade went horribly wrong!

by Lars Lundstrom -

I tried that and I only got one file, the file with id 1. Right now we're trying to mess with the upgrade script so that it won't care whether the files from the old file structure exists or not.

All files have been hashed and moved to filedir but a lot of the files are missing in the newly upgraded database, probably because they were already hashed and moved the first time we ran, and sadly interrupted, the script.

If we couldrerun the script and have it update the database even though it can't find the old files I think we're in business.

In reply to Lars Lundstrom

Re: Upgrade went horribly wrong!

by Brian Lockwood -

To summarise all the above. You seem to have adandoned an upgrade part way through. The effect is unpredictable. This is unlikely to be a system that can be rescued and made into a reliable moodle.

The upgrade process translates legacy storage to the new system which is much more sophisticated and allows the personal file are etc to work. You appaer to have down your partial upgrade before that transfer took place and so you may have an intact 1.9.x moodledata. This is a good thing and you should back it up.

If this is correct then the Moodledata + old database +1.9.x site should be a viable moodle. Assuming your moodledata is not absolutely massive, you can do the restore and upgrade on a machine not connected to your original system. I would have thought that this is your way forward.

The most likely source of rescue is to start from your original system. I am not clear whether you had a backup or not. Since you appaer to have an IT department, it is likely thta backups are available somewhere.