Upgrading from 2.7 to 3.1.1

Upgrading from 2.7 to 3.1.1

by Gunilla Brattberg -
Number of replies: 12

I have a moodle installation in 2.7 with about twenty courses. Which is the easiest and safest way to upgrade that installation to 3.1.1? I rembember that it was lots of problems going from 1.8 to 2.7, passing from 1.x to 2.x. Is it easier to pass from 2.x to 3.x?


As I have courses running in 2.7 dare not risk problems so I installed 3.1.1 in a new folder with a new database and had the intension to move copies of all the courses to this new installtion, but I really don´t know how to do that. I can´t identify the courses in moodledata. 


I use theme formal-white and installed a copy of that theme-folder int the new file-three but this formal-white  doesn´1 appear among selectable themes in the administration menu.

Average of ratings: -
In reply to Gunilla Brattberg

Re: Upgrading from 2.7 to 3.1.1

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers

I recommend getting your Moodle 3.1.1 looking and acting the way that you want it to.  I was a big user of Formal White, and yes, it is not a standard theme now in Moodle.  You might be able to load it as a plugin.  But I got away from Formal White and now use the MORE base theme, with CSS modifications.  I gave a presentation about this at this year's MoodleMoot 2016 US.  Use any of my posted stuff as needed.

I cannot recall if there are any steps in going from 2.7 to 3.1.1.  Others here might be able to help you.

Make a backup of your moodledata, mysql database, and even your moodle before doing anything else.  Once you have a backup, you can start updating your Moodle 2.7.  You might actually consider doing this in steps, even if you don't have to.  I would upgrade to 2.8, then 2.9, 3.0, and finally 3.1.1.  Then you can either apply your 3.1.1 changes to this upgraded version, or you can move the old (but now 3.1.1) database and moodledata into your new Moodle 3.1.1.  I don't know if either is better, but maybe someone else here will have some ideas.

If you have never backed-up your Moodle, learn how to do this via SSH.  This will help you also move your Moodle if you end up doing so.  It's really not that hard.

Along the way, you will probably notice that "opcache" is recommended, and there are also some fixes to the mysql database.  These will become obvious to you.

I assume that you have SSH access to your server, right?  Are you fairly good at using it?

Since you have a Moodle 3.1.1 running right now, you at least know that this version works on your server.  Go to Site Admin | Server |Environment to see if you get all OKs.

I think that you will be pleased with Moodle 3.1.1.  Many good improvements.  I have Moodle 3.1.1+ (Build: 20160811) running right now (also about 20 courses.)


In reply to Rick Jerz

Svar: Re: Upgrading from 2.7 to 3.1.1

by Gunilla Brattberg -

Thank you for your description.

I know nothing about SSH, but I will ask my web host.

In my 1.x version I used the book module and lesson module in some courses. When I updated to 2.7 all the image links got broken. When I now try to relink I find a path like this:

http://www.varkstaden.se/webbklinik/file.php/16/s.jpg

Where in the file three do I find the image s.jpg?


In reply to Gunilla Brattberg

Re: Svar: Re: Upgrading from 2.7 to 3.1.1

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers

I am not exactly sure.  If you moved your moodle when you upgraded to 2.7, maybe this created the broken links.  There is a tool for fixing this, but I don't have the URL.  Look in the moodle docs under "migrating your moodle."  This problem seems to present itself sometimes when people move their moodles.

In reply to Gunilla Brattberg

Re: Svar: Re: Upgrading from 2.7 to 3.1.1

by Grant Mucha -

Possible issue on server level?

On a few of my updates I had a similar issue. I've never really understood why Moodle uses a php file in the middle of a URL.

Nginx: fastcgi_split_path_info  ^(.+\.php)(/.+)$;



In reply to Rick Jerz

Re: Upgrading from 2.7 to 3.1.1

by Premi Sivanesan -

Hi Rick

I am facing the similar issue as in the site is giving Mixed Moodle versions detected, upgrade cannot continue error. Dont know how to fix it. The app is in a web hosting site (Crazy Domain).

Any advise?
Cheers

Premi

In reply to Premi Sivanesan

Re: Upgrading from 2.7 to 3.1.1

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers

I am not sure what your problem is.  Is it a problem with broken picture links, or mixed versions of Moodle?

In reply to Rick Jerz

Re: Upgrading from 2.7 to 3.1.1

by Premi Sivanesan -

Hi Rick

Its Mixed versions of Moodle.

I have done a fresh install and backed up the old one so all good now.

Cheers

Premi

In reply to Premi Sivanesan

Re: Upgrading from 2.7 to 3.1.1

by Grant Mucha -

Do not copy over your old installation as the upgrade instructions indicate. Trying to copy or load a new version of moodle on top of your old version will almost always results in Mix Moodle versions detected.

In reply to Grant Mucha

Re: Upgrading from 2.7 to 3.1.1

by Premi Sivanesan -

Hi Grant

Thank you for the time taken in providing such detailed information. 

Yes as per your instructions, was able to re-install 3.1 without any issues and the site is back up now. Yay!

Cheers

Premi

In reply to Gunilla Brattberg

Re: Upgrading from 2.7 to 3.1.1

by Grant Mucha -

In my experience the migration from 2.7 to 3.1 has been pretty simple but it will likely depend how much you've customized Moodle with plugins and your selected theme.

Obviously check that you server meets the requirements. Typically this is also a good time to consider upgrading your server with the latest versions of MySQL/MariaDB, PHP/HHVM, Nginx/Apache (depending on your flavor).

In my opinion the safest and likely easiest way to upgrade is to clone your existing installation. Once you have a clone in place you never really have to worry about breaking anything and can fall-back to old installation. I typically clone to an external server for safety reasons to avoid deleting the wrong database or files by mistake. This also allows me to modify my windows host files and add the new server IP and then work on the clone using the same domain as I would on the production website. This way all your actions will be carried out in a temporary environment and at any time if you fail you can easily restart the process or simply revert back to your old installation (which would be untouched).

On your clone move your old installation to something like "moodle.old".

Then proceed to copy your config, themes, and plugins from your old installation to your new.

Instructions are pretty detailed here: https://docs.moodle.org/31/en/Upgrading

The mixed Moodle issues you are facing are likely from trying to copy a new moodle installation over your old moodle.

  1. Move your old Moodle software program files to another location. Do NOT copy new files over the old files.

Following the upgrade guide is pretty critical to avoiding issues.

Another tip for anyone else reading this is the CLI provided by Moodle. There are a bunch of very useful command line tools provided by Moodle.

https://docs.moodle.org/31/en/Administration_via_command_line

Notes

I would not really recommend trying to "move" anything. You would be far better off completing an actual "upgrade".

I would consider testing first with the default theme provided. Once you are certain the upgrade is successful then consider moving to your previous theme.

Sorry I forgot to mention to make sure your plugins are also compatible with Moodle 3.1+