Errors abound in DB when going from 2.0 to 2.2

Re: Errors abound in DB when going from 2.0 to 2.2

by Ken Task -
Number of replies: 0
Picture of Particularly helpful Moodlers

+1 to what Bret said.

The clip of the head of the SQL dump omits the version of MySQL - assume it's high enough and the ultiity to dump (mysqldump) creates them without issue.

What's more important is down further ...

Statements like;

DROP TABLE IF EXISTS `mdl_assign_submission`;

would do what Bret says on the fly when importing an sql dump.

Think it probably best NOT to attempt move + upgrade at the same time - in this case.   Just get a copy of what you have on one to the other.   The only changes needed then: change to config.php and changes in the sql file for http://site/ to http://newsite/ before importing (or after with search and replace IF it existed in 2.0).

Once the move has been checked and it functions then git update the code folder.

I see it's linux but mind disclosing what 'flavor'?   versions of Apache, PHP, MySQL?  And it appears you have command line access so is it remotely hosted VPS?

And one last suggestion ... consider using command line for the upgrade:

check out /moodlecode/admin/cli/ and you'll see an upgrade.php file:

"Command line Moodle upgrade.
Please note you must execute this script with the same uid as apache!

Site defaults may be changed via local/defaults.php.

Options:
--non-interactive     No interactive questions or confirmations
--allow-unstable      Upgrade even if the version is not marked as stable yet,
                      required in non-interactive mode.
-h, --help            Print out this help

Example:
\$sudo -u www-data /usr/bin/php admin/cli/upgrade.php

While "they" say to use sudo as apache user, runs under root user as well.

Reason ... eliminates any browser/networking issues ... it's just PHP ON the server.

'spirit of sharing', Ken

Average of ratings: Useful (1)