Upgrading difficulties from 2.7 and now trying a new installation of 3.7 and upgrading from a course backup?

Upgrading difficulties from 2.7 and now trying a new installation of 3.7 and upgrading from a course backup?

by Ian L -
Number of replies: 10

Man upgrading moodle is a massive headache. i tried years ago and got the mysam innodb conflict in the upgrade process. I read a lot and cant' figure it out spent the day doing this.

I made a copy of the site in a new folder and tried but no.

Now I am trying a new installtion of 3.7 in a new folder and that worked and I took a backup of one course from 2.7 and am restoring it to 3.7.

Anybdoy ever perform a upgrade with this method? It seeems to be working. And the 2.7 course tranferred to 3.7.

What are the things that I will need to do and double check?

I just saw there were only 5 users imported instead of like a 100. $%^!


Average of ratings: -
In reply to Ian L

Re: Upgrading difficulties from 2.7 and now trying a new installation of 3.7 and upgrading from a course backup?

by Ian L -
So for some reason it's not importing all the users in the courses. I read that if you bulk user actions import then that helps but it didn't.

So

I went back to the official way to upgrade where I uploaded the new files of 3.2 (because I read I need to do that before 3.7) to a copied folder and when I click on continue it just spins back to the same page.

This is my config file. I am confused if I do a new installation or use the config file when I do it gets stuck in a loop.

<?php  // Moodle configuration file

unset($CFG);
global $CFG;
$CFG = new stdClass();

$CFG->dbtype    = 'mysqli';
$CFG->dblibrary = 'native';
$CFG->dbhost    = 'localhost';
$CFG->dbname    = 'e5_moodle3';
$CFG->dbuser    = 'e5_moodle2';
$CFG->dbpass    = '8Vuw!zcF1S';
$CFG->prefix    = 'mdl_';
$CFG->dboptions = array (
  'dbpersist' => 0,
  'dbport' => '',
  'dbsocket' => '',
);

$CFG->dataroot  = '/home/e5/moodledata';
$CFG->admin     = 'admin';
In reply to Ian L

Re: Upgrading difficulties from 2.7 and now trying a new installation of 3.7 and upgrading from a course backup?

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Hi

You wrote:
> I went back to the official way to upgrade where I uploaded the new files of 3.2 (because I read I need to do that before 3.7) to a copied folder and when I click on continue it just spins back to the same page.

The proposed path from 2.7 to 3.7 is indeed over 3.2:
- https://docs.moodle.org/32/en/Upgrading#Check_the_requirements
- https://docs.moodle.org/37/en/Upgrading#Check_the_requirements

Personally, I feel more comfortable with the LTS releases. I would go 2.7 (LTS) to 3.1 (LTS). From there to 3.5 (LTS):
- https://docs.moodle.org/31/en/Upgrading#Check_the_requirements
- https://docs.moodle.org/35/en/Upgrading#Check_the_requirements

Then take a long pause. 3.5 is still supported.

For your "dup" business I suggest studying https://docs.moodle.org/en/Moodle_migration carefully.
3.5 is still supported.
In reply to Ian L

Re: Upgrading difficulties from 2.7 and now trying a new installation of 3.7 and upgrading from a course backup?

by Ken Task -
Picture of Particularly helpful Moodlers

Upgrades from older versions which are 10 major versions and many many point releases behind would be a challenge for anyone ... do able ... but would require a lot of work.

Yes, when OP decides migrating an old version to newest version is too much, the backup/restore route is the next logical option, but ... as you have discovered might not work 100%.

On old system ... do you have any plugins/addons?  Can you find compatible versions of those addons/plugins for the 3.7.x system and install them prior to restore attempts.

A plugin used in a course and included in a backup could have strange results when restored to the higher version.

Since theming has yet again undergone a major change, check the courses from the 2.7 site to see if they were set to force the use of a 2.7 compatible theme.   Same with any addon in the 2.7.

When restoring to the 3.7.x, turn on debugging to see if there isn't something going on ... not bad enough to prevent the restore, but would affect a clean restore.

Large courses ... will require more resources on restores.   PHP settings for time for a script to run, memory a script can use, as well as some DB tweaks ... max_packet_allowed as well as other DB settings might need tweaking upwards.

'SoS', Ken

In reply to Ian L

Re: Upgrading difficulties from 2.7 and now trying a new installation of 3.7 and upgrading from a course backup?

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Upgrading from one version of Moodle to the next, requires reading the release notes, comparing with your current system and some careful planning. Even better, doing a test run.

Going through 10 major versions requires (at least) 10 times the planning. It almost certainly will involve conflicts in versions of server software that you will need to resolve. So, yeh, it's not easy. I would not take it lightly either.
In reply to Howard Miller

Re: Upgrading difficulties from 2.7 and now trying a new installation of 3.7 and upgrading from a course backup?

by Ian L -
So I made a copy of the live site and put it in a new folder, but what I am confused with is for that copy site do I need a new database, moodledata folder...

Should all of these be different from the live site?
CFG->dbname = 'e5_moodle2';
$CFG->dbuser = 'e5_moodle2';
$CFG->dbpass = '8Vuw!1S';

$CFG->wwwroot = 'https://www.course.e5.com';
$CFG->dataroot = '/home/e5/public_html/moodledata';
$CFG->admin = 'admin';
In reply to Ian L

Re: Upgrading difficulties from 2.7 and now trying a new installation of 3.7 and upgrading from a course backup?

by Ken Task -
Picture of Particularly helpful Moodlers

You need a dup of the DB by another DB name.  And a dup of moodledata for site migration trials.   There are massive changes to DB ... while moodledata not so much so ... still best to use copies of your production server in a migration trial.

As far as DB credentials (user/login/pass) could use same if the new DB is setup to allow user the privs needed for Moodle.

**DO** check config-dist.php after each step or before.  Warning ... some DB settings await during the upgrade path ... and will bite if not aware.

Do you have ssh/shell access to your site?

Does the system upon which you are hosted have 'git'?

Is by far much easier to 'march' a moodle upwards using git.

https://docs.moodle.org/37/en/Git_for_Administrators

In affect, no FTP or other file download/upload/unzip, etc.  Git is a 'pull' of code from Moodle code repo directly to your server ... no download from Moodle.org only to have to turn around and upload to your server.  Concept of server to server.

And once at a version of Moodle you can run, much easier to maintain (update) as well as upgrade ... should you move your moodle code/db/data directory to VPS hosting.

'SoS', Ken

In reply to Ken Task

Re: Upgrading difficulties from 2.7 and now trying a new installation of 3.7 and upgrading from a course backup?

by Ian L -
Some success...

I am wondering. So I just moved the 3.7 upgrade from the test directory to the live server and it is missing some native images like navigation arrows, the menu icon, icons, etc.

What I am wondering is about the moodledata folder. the new moodledata folder is in a slightly different location and I was wondering if that matters? Old moodle data was at public_html/moodledata and now it's at /moodledata.

Is it a matter of time before it corrects itself or ?
In reply to Ian L

Re: Upgrading difficulties from 2.7 and now trying a new installation of 3.7 and upgrading from a course backup?

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers
It all depends upon what you mean by "I made a copy of the live site..." I am a little late to this conversation, and Howard and Ken provide very good information. I am not in the same league, but I will try to add my 2 cents (US) to help.

Every moodle installation needs three things. 1) the moodle application, which is what one downloads and extracts to their web server. 2) a moodledata folder, which can really be named anything, but should not be in your server's public web area. 3) A database, most commonly something like a MySQL database (but others are supported)

Linking these three major components together is the config.php file.

So when you say "I made a copy" are you saying you copied your moodle1 folder to moodle2, and you copied moodledata1 to moodledata2, and you copied your moodledb1.sql to moodledb2.sql? If not, you could end up with a mess. If so, then you might just be struggling with making your config.php(2) correct. But from what you have said, it doesn't appear to me that your "copy" is a correct "copy." 

But I am not really sure what you are trying to do, and you might be on the correct journey. Let's say you want to preserve your moodle1 application, which is Moodle 2.7. And let's say you don't want to destroy anything. I am one who believes that you might be on the correct path by making an exact copy of your Moodle 2.7 site. let's call it moodle2, and then try to upgrade your moodle2 "system" step by step. I do not memorize the major steps, and as Ken and Howard have pointed out, you're about 10 steps behind. The challenge in doing this is that there are server-side changes along the way, like php5 to php7, and database changes. I have never done a Moodle2.7 to Moodle3.7 upgrade, but I have upgraded my Moodle regularly with many "point" changes. Along the way, yep, I had to do some server-side things. Yes, it can be done from what others, like Ken, have said. But you have to have your head on straight as you do this (not implying at all that your blue profile is "not straight."  smile

Well, Ian, hope that I helped a little.   (I just see that Ken has given more advice, slightly sooner than I made this post.)
In reply to Howard Miller

Re: Upgrading difficulties from 2.7 and now trying a new installation of 3.7 and upgrading from a course backup?

by Ian L -
I got some success. And went to 3.2 to 3.7 and everything seems good except after I moved the new upgrade to the old's space some of the images aren't showing such as in the navigation, menu arrows and stuff. Know why?
In reply to Ian L

Re: Upgrading difficulties from 2.7 and now trying a new installation of 3.7 and upgrading from a course backup?

by Ian L -
Success! One of the problems was the database I had uploaded wasn't a complete one and that's why they "sessions" table didn't exist. Next problem was I had to convert myisam to innoDB 250 tables one by one.

I just moved the test directory of the upgrade over to the live site and it looks o.k. but it's missing images.