Upgrading from 2.8 to 3.0 is taking hours

Upgrading from 2.8 to 3.0 is taking hours

by Amanda Doughty -
Number of replies: 5
Picture of Core developers Picture of Plugin developers

We have carried out a dry run of our 2.8 - 3.0 upgrade on a test server and it took 9 hrs. We are in the process of resetting our test server to run it again today with a complete copy of our live data. Our Unix team say that our DB is 150GB and the upgrade requires the same amount of temp space in order to run.

Does anybody know why this would be? And has anyone else had similar issues? Or no issues?

Thank you

Average of ratings: -
In reply to Amanda Doughty

Re: Upgrading from 2.8 to 3.0 is taking hours

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

The upgrade is formed of a number of separate steps (each separate if statement in https://github.com/moodle/moodle/blob/master/lib/db/upgrade.php#L855). To say more, we really need to know which step it is that is being slow.

You might be able to work that out by turning on more logging on you rdatabase server, or you might need to edit the upgrade_main_savepoint function, so that it outputs some progress information every time it is called.

It would be very helpful to know which part of the upgrade is slow. Then we might be able to do somethign about it.

In reply to Tim Hunt

Re: Upgrading from 2.8 to 3.0 is taking hours

by Amanda Doughty -
Picture of Core developers Picture of Plugin developers

The next test run should output some more info. I'll post here when I get it.

In reply to Tim Hunt

Re: Upgrading from 2.8 to 3.0 is taking hours

by Amanda Doughty -
Picture of Core developers Picture of Plugin developers

Looks like I can get this info from upgrade_log? We have reverted our test system for the next dry run. I'll post more info here when it's finished.

In reply to Amanda Doughty

Re: Upgrading from 2.8 to 3.0 is taking hours

by Michael Aherne -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

The place we're noticing the upgrade from 2.8 to 3.0 taking a long time is in logstore_standard, where it's adding a foreign key to the database table. You don't mention what database you're using but as far as I remember MySQL takes up a lot of temp space when adding indexes or keys, so it could be something to do with that.