Moodle Migration from 3.3.9+ to 3.8.1

Moodle Migration from 3.3.9+ to 3.8.1

by Wendell Mayes -
Number of replies: 9

I have Moodle 3.3.9+ deployed on Debian 8 configured with MySQL and I want to upgrade the build to 3.8.1 running on Ubuntu 18.04LTS and PostgreSQL.

The reason is to move to a current OS and the database type recommended by Moodle on our devs. However, I can also decide to stick with MySQL if that is the better option. We also have systems running the old build that are currently in use, and the desire is to migrate to the new build without loosing and data/content and as seamless as possible.

I have searched through the forums and several sites looking for the best way to accomplish, and not being a database guy, I have not found a smooth transition.

What I have attempted:

1. Direct migration using the Moodle tool - Was able to complete the process, however, the tool would not allow me to use the 'mdl_' since it was already in the destination database. I could migration if I changed the prefix to something like 'mdl2'. I also attempted the migration after creating the moodle database on the destination server, but before installing moodle, which is where I am now. I copied over the moodle and moodledata directories, but nothing is working as of yet. I am sure all the changes I am making from old to new, new PHP, and database is adding complexity and problems

2. Other options on my list to attempt are:

  1. 3.3.9+ (MySQL) to 3.8.1 (PostgreSQL) via Moodle migration
  2. 3.3.9+ (MySQL) to 3.8.1 (PostgreSQL) via manual db backup/restore
  3. 3.3.9+ (MySQL) to 3.8.1 (PostgreSQL) via Moodle Adminer Export/Import
If this does not work, I was considering sticking with MySQL on the new OS and attempting the same migration tests.
  1. 3.3.9+ (MySQL) to 3.8.1 (MySQL) via Moodle migration
  2. 3.3.9+ (MySQL) to 3.8.1 (MySQL) via manual db backup/restore
  3. 3.3.9+ (MySQL) to 3.8.1 (MySQL) via MySQLAdmin Export/Import

Is this migration possible? Do I need to move to a version before going to the latest?

Any help would be appreciated if someone knows a good way to accomplish this task.

Average of ratings: -
In reply to Wendell Mayes

Re: Moodle Migration from 3.3.9+ to 3.8.1

by Ken Task -
Picture of Particularly helpful Moodlers

Can't hyperjump from 3.3.9+ to 3.8.1 (which is now 3.8.2).  Must upgrade in stages.

In your existing 3.3.9+, Site Admin menu -> Environment.   Update component.

Once component updated, use the drop down pick list for Moodle version and step through higher versions - one at a time.  Make notes what the check says ... reds must fix before attempting upgrade - yellows - OK but best to fix.

IMHO, you might ready for an easier way to do a 'moode march' ... that easier way is using git to acquire core code.

A couple of questions ... how many plugins do you have?   Map out plugins to see if they have a compat version for destination version.

Have you customized any code ... other than tweaks to themes?

Using git to side load a version 3.4.highest into your existing 3.3.9+ code and using git to upgrade core code would be the first step.

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

Some additional which will help.

https://sos.sosoftexas.org/blog/index.php/2018/09/02/using-git-with-moodle-side-load/

https://sos.sosoftexas.org/blog/index.php/2018/09/02/using-git-to-update-backup-site-with-one-bash-shell-script/

When one migrates/upgrades and changes DB backend in one step could lead to issues which would then could be difficult to pinpoint.  So think I'd use MySQL through the 'march' ... get site upgraded to 3.8.2 .. and working ... plugins/theme and all ... then tackle MySQL -> Postgres - should you just insist (MySQL 5.highest and 8.0.x now available has been kinda a standard for years ... and their ain't nothing wrong with MySQL ... but that's my 2 cents.

'SoS', Ken

In reply to Ken Task

Re: Moodle Migration from 3.3.9+ to 3.8.1

by Wendell Mayes -
Hey Ken,

Thx for this feedback. I never noticed the update component options.

1. WRT plugins, I only have the following installed and in use:
-BigBlueButtonBN - No longer needed
-RecordingsBN - No longer needed
-Email-based self-registration with admin confirmation
-Adaptable Theme
-Moodle Welcome

Themes I plan to add include:
-Moodle Adminer
-Moove Theme
-Admin Presets

2. Customized Code: All Moodle code is default

Great input! I will start on this now. Thx.
In reply to Wendell Mayes

Re: Moodle Migration from 3.3.9+ to 3.8.1

by Wendell Mayes -

To add to my original post for clarity and ensure your recommend process would remain the same: I would be starting with two systems, my old Debian 8 running Moodle 3.3.9+ and my new build running Ubuntu 18.04 LTS and Moodle 3.8.x. 

My hope was to export or backup the database from the old system, copy it to the new, and restore.

In reply to Wendell Mayes

Re: Moodle Migration from 3.3.9+ to 3.8.1

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Moodle IS the database in many ways. You can't somehow import an older database into a newer one.
In reply to Wendell Mayes

Re: Moodle Migration from 3.3.9+ to 3.8.1

by Ken Task -
Picture of Particularly helpful Moodlers

+20 to what Howard is telling you! smile

'SoS', Ken

In reply to Wendell Mayes

Re: Moodle Migration from 3.3.9+ to 3.8.1

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
I would strongly discourage you trying to convert from MySQL to PostgreSQL. There are subtle differences and no 100% reliable tool to do it. Your chances of introducing interesting bugs are considerable. The disadvantages far outweigh the perceived advantages.
Average of ratings: Useful (1)
In reply to Howard Miller

Re: Moodle Migration from 3.3.9+ to 3.8.1

by Wendell Mayes -
Thx for the response Howard.

I think you are Ken are on the same page. So we should I just stick w/ MySQL on the new build?
In reply to Wendell Mayes

Re: Moodle Migration from 3.3.9+ to 3.8.1

by Ken Task -
Picture of Particularly helpful Moodlers

"So we should I just stick w/ MySQL on the new build?"

That's a question!!!   Ok ... yes ... stick with MySQL

'SoS', Ken