restauring a moodle 3.2

restauring a moodle 3.2

by Malik Koné -
Number of replies: 8

Hi,

I'm a big fan of moodle, running my own VPS and moodle on it for years but I had to stop maintaining my website about 3 years ago and I'm now trying to restore it. 

Unfortunately things move quickly and my sql dump, moodledata and code base are largely outdated.  I ran moodle 3.2.


I'm looking for a way to set back up my moodle website so I can export properly my question and courses in a format that I will be able to import in moodle 3.9


I fairly conformable with the command line, and I usualy install and upgrade moodle via git.


Thank you

My main problem to run moodle 3.2 is to find, install and run the correct and compatible versions of php and mariadb.  I'm on linux (debian/ ubuntu/ mint/ flavor)

I looked into using some dockerised version of php and mariadb, but I must admit that I'm not confortable with docker yet.  So Is there another way  using a modern OS ?

Average of ratings: -
In reply to Malik Koné

Re: restauring a moodle 3.2

by Ken Task -
Picture of Particularly helpful Moodlers

What version is your operating system?   If still supported by distributor one could upgrade the PHP/MariaDB via package manager at an appropiate step in the 'git march' of your moodle - 3.2 -> 3.5 -> 3.9 is possible.

https://docs.moodle.org/35/en/Upgrading

https://docs.moodle.org/39/en/Upgrading

Please see: http://www.syndrega.ch/blog/#php-and-dbms-compatibility-of-major-moodle-releases

The other path is to check moodle backup preferences so that you have included in individual course backups what is desired.   Courses 3 years old probably don't need to have users included nor keep events etc.   Just the course content.

There is a backup.php script in /code/admin/cli/ and you could exercise the option to save the backup to a directory you create manually.   This allows you to download the course backups.

New hosting that has the PHP/MySQL/MariaDB you need to run 3.9.x ... install the 3.9 moodle via git.   Restore the backups.

Just one thing you'd have to do if you ran any addon plugins in the 3.2 site ...  research if they still exist and have a 3.5 and a 3.9 version for installing into your fresh 3.9 site *before* restoring courses.

'SoS', Ken


Average of ratings: Useful (1)
In reply to Ken Task

Re: restauring a moodle 3.2

by Malik Koné -
Hello Ken,

I'm running Mint 19.1 which is based on Linux 5.0.0-32-generic or Ubuntu 18.04.

I don't have an 'upgrade problem' as if I had my original website still running on my old VPS (which is no more) I would have not problem upgrading it step by step. Rather, I have the problem or restoring a running 3.2 moodle website from a moodledata directory and an sql dump.
For the code base, I use the 3.2 git branch but then:
- I need to have a php 5.5.31 talk with a 10.0.26-MariaDB on a fairly recent OS (my new VPS or local OS), and I have difficulties installing php 5.5.31 with all required extensions.

I'm going the docker route but I'll need to make sure all extensions are included in the images, they probably are not and I'll be stuck.

Ideally, I would find a docker image of a moodle 3.2 + php + mariadb but I did not yet
Worst case scenario, I start from the old OS, installing the same that I had 3 years ago and restore the moodle 3.2 on it, using package manager to install php 5.5.31 and mariadb.
In reply to Malik Koné

Re: restauring a moodle 3.2

by Ken Task -
Picture of Particularly helpful Moodlers

Mint

Thought Linux Mint is a desktop distro?  What's needed is a long term support server distro which has the ability to use package manager to upgrade PHP and MariaDB when Moodle version of the future requires them.

If Docker set ups don't use nor provide package manager or a way to upgrade PHP/MySQL/MariaDB, then think I'd steer clear of them.

Besides that, the kernel and other operating system ... there are updates all the time ... security related.  While Linux security in general is pretty good, not a Ft. Knox.   One should keep up to date.

Think I'd install DB first and then inspect mdl_config_plugins table
to find the addons you may have forgotten you installed when site was a 3.2. You'd then would know which ones you need to research for 3.9.x compat versions and install those in the fresh code you will have.

Warning: themes changed ... best to use a stock themea that came with Moodle version when you march to avoid issues with upgrades.

My 2 cents ... but do let us know how it went! smile

'SoS;, Ken

In reply to Ken Task

Re: restauring a moodle 3.2

by Malik Koné -
My aim is just to set-up the moodle 3.2 website once, so I can export my course and question in a format easy to import in a modern version. I don't want to update the old moodle course to a recent version, so I try dockers...

here my docker-compose.yml file
and my very insecure but onetime use config.php

I'm left with a database connexion problem that I've been investigating without success for more than days.

```
Debug info: Access denied for user 'moodlehq_user'@'192.168.192.3' (using password: YES)
Error code: dbconnectionfailed
Stack trace:
  • line 525 of /lib/dml/mysqli_native_moodle_database.php: dml_connection_exception thrown
  • line 344 of /lib/dmllib.php: call to mysqli_native_moodle_database->connect()
  • line 615 of /lib/setup.php: call to setup_DB()
  • line 382 of /config.php: call to require_once()
  • line 30 of /index.php: call to require_once()
```
I kind of lost, between layers of dockers, moodle, apache, php, and mariadb... I don't know of to get my site up and running once.. maybe starting from an old OS will finaly be the easiest.
In reply to Malik Koné

Re: restauring a moodle 3.2

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

May be too late now. If you want to avoid the added layer of complication due to Docker, you could do the upgrade conventionally.

One path would be to:
- create a server VM in your Mint, say Debian Stretch (PHP 7.0) https://wiki.debian.org/PHP
- https://docs.moodle.org/32/en/Site_restore your https://docs.moodle.org/32/en/Site_backup in to it
- https://docs.moodle.org/35/en/Upgrade (to 3.5)
- dist-upgrade to Debian Buster (or create a new VM)
- march the Moodle code to 3.9 https://docs.moodle.org/39/en/Git_for_Administrators#Updating_your_installation
- the Moodle upgrade script will be triggered automatically, if you had been logged in as admin.

In reply to Visvanath Ratnaweera

Re: restauring a moodle 3.2

by Malik Koné -
That last link is gold to me, the other I new already. Thank you.