Migrating Server and Updating Moodle from 2.4 to 3.6+

Migrating Server and Updating Moodle from 2.4 to 3.6+

by John Nichols -
Number of replies: 42

Hello,

I am helping a friend with a Moodle server version 2.4.1, which according to their admin, will not let them make courses for 2021. On a semi-unrelated note they had already planned to move to a SiteGround Cloudbased Server from a Linux Apache 2.0 server (PHP Version 5.4.16, mysql  Ver 15.1 Distrib 5.5.56-MariaDB, for Linux (x86_64) using readline 5.1). We didn't realize though that the new SiteGround server appears to prohibit older versions of PHP from before 7.3.25 (which is incompatible with Moodle versions before 3.6). So I have been researching upgrading Moodle from 2.4.1 to the current version (3.10).

I have access to the Moodle Admin site, remote access to the root of the current server (and am using Putty and WinSCP), and I have access to the new server as well. I've been able to backup the current SQL DB and backup the Moodle code and data. I'm wondering now if I should step the upgrade process forward from 2.4.1 to 2.7, then to 3.0, then 3.5, then 3.10 (and the new server) or if I should take the advice Ken Task gave about restoring the courses on a fresh install of Moodle ( https://moodle.org/mod/forum/discuss.php?d=409798#p1653368 ).

They have 93 courses separated by 9 categories which also mostly have 3 subcategories. And they have 308 installed plugins (with 59 disabled). I am only becoming familiar with Moodle and Linux, so would appreciate any advice or instructions about what to do. I do not know if they have Moosh or Git installed on the Linux server. Please let me know if I've left out any needed information.

Thank you for any help you can offer!

Average of ratings: -
In reply to John Nichols

Re: Migrating Server and Updating Moodle from 2.4 to 3.6+

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

You've done some thorough reading! Yes, from 2.4 to 2.7, then to 3.0, then 3.5, then 3.10 is a feasible route. I would update to the latest first, that is 2.4.11 and then march along 2.7, 3.1, 3.5 and finally to 3.9 - because all of them are LTS. But that is a detail. The challenge will be the system software, PHP and MySQL/MariaDB to be specific, have their own min. and max. versions. See http://www.syndrega.ch/blog/#php-and-dbms-compatibility-of-major-moodle-releases.

Transfer course by course through course backups and restore is much simpler, apart from the repetitive work for the 93 courses. But I am not sure how much user data can be recovered.

In either case the 308 installed plug-ins are going to be a major problem. You need find out the still maintained plug-ins first.

BTW, you know that there is a hack against the "end of time" problem: https://moodle.org/mod/forum/discuss.php?d=413498#p1667101 ?
In reply to Visvanath Ratnaweera

Re: Migrating Server and Updating Moodle from 2.4 to 3.6+

by John Nichols -
Thank you so much for your reply! Btw, I have now installed Git, Moosh, and updated PHP to 5.6.4 on the server.

When you say, "But I am not sure how much user data can be recovered." Is that because the data files from the old version may not be compatible with the latest version? And if so, will updating step by step allow the user data to be carried along?

I have the admin to help me test the updates as we go along. Should she be able to tell me which plugins they are definitely using? And on the subject of plugins, should I go ahead and uninstall the disabled ones (and any they are not using)?

I did not know about the hack but should have thought there would be one. Either way we are not able to keep the old server so we need to update anyway.

Thank you again.
In reply to John Nichols

Re: Migrating Server and Updating Moodle from 2.4 to 3.6+

by Ken Task -
Picture of Particularly helpful Moodlers

Plugin/addon checker ..

Find short names of all the plugins ... seen when viewing additional plugins.

Create a addons.txt file at code root that list the plugin shortnames one per line:

Looks like:

local_mailtest
theme_moove

Create a bash shell script that will use that addons.txt file and loop through a moosh command to check the plugin.   Call it 'checkaddons'.

#!/bin/bash
#
echo 'Add-on listing: ';
cat ./addons.txt;
echo '---------------------';
for i in `cat ./addons.txt`
do
   echo "Addon in que: $i";
moosh -n plugin-list |grep $i
done

Make above executable and seen only by user that created:

chmod u+x checkaddons

chmod go-r checkaddons

or use 'source checkaddons'.

Output looks like:

Add-on listing:
local_mailtest
theme_moove
---------------------
Addon in que: local_mailtest
local_mailtest,2.5,2.6,2.7,2.8,2.9,3.0,3.1,3.10,3.2,3.3,3.4,3.5,3.6,3.7,3.8,3.9,https://moodle.org/plugins/download.php/22516/local_mailtest_moodle310_2020092000.zip
Addon in que: theme_moove
theme_moove,3.10,3.2,3.3,3.4,3.5,3.6,3.7,3.8,3.9,https://moodle.org/plugins/download.php/22801/theme_moove_moodle310_2020110900.zip

'SoS', Ken

Average of ratings: Useful (1)
In reply to John Nichols

Re: Migrating Server and Updating Moodle from 2.4 to 3.6+

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

> "But I am not sure how much user data can be recovered."

By user data I meant basically the work done by students: forum posts, assignment submissions, completed assessments, .. In the extreme case even usernames and passwords. And it referred to:

> Transfer course by course through course backups and restore is much simpler, apart from the repetitive work for the 93 courses. But I am not sure how much user data can be recovered.

In case you do a course-by-course restore. Somewhere there was a break in Moodle, course backups from sites older than that could not recover the user data if restored in sites newer than that. If you are interested only in the content, what the teachers have prepared, then no problem. Since you are taking the site-upgrade path, which is technically more demanding but much shorter and coming from release 2.4 you have a good chance of recovering everything. So not relevant.

>> In either case the 308 installed plug-ins are going to be a major problem. You need find out the still maintained plug-ins first.

Possible a false alarm, in case you counted the core plug-ins. I thought you mean non-core plug-ins. I think in Moodle jargon plug-ins are all, core and non-core (third party), the non-core ones are called add-ons.

Anyway, you are getting good advice from the others. Please follow them.
In reply to Visvanath Ratnaweera

Re: Migrating Server and Updating Moodle from 2.4 to 3.6+

by John Nichols -
I believe we will need the student data and going to do the Moodle updates if possible. I found out the plugins were all standard to the version 2.4. Thank you for the course-by-course method link!
In reply to John Nichols

Re: Migrating Server and Updating Moodle from 2.4 to 3.6+

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers
Of the 308 installed plugins, how many are additional? Most of those are going to be core. If only a few are additional, it will make the upgrade method far easier.
If you do the upgrade route, you will need to do that on the original server and wait until you get to at least 3.6 before you migrate (this will allow the site to function as you march through the different versions). You will need to upgrade PHP at least once during the upgrade. I still think this would be much quicker and far less tedious than copying over so many courses.
In reply to John Nichols

Re: Migrating Server and Updating Moodle from 2.4 to 3.6+

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers

With an upgrade like this I'd normally set up one or two interim servers with the PHP versions needed for the Moodle upgrade "steps", either local VMs or low-cost VPSes (e.g. DigitalOcean). Find out how big the site is and how long it takes to copy between servers. Rsync – which can copy incremental changes after a complete copy – is useful for copying Moodledata.

I'd recommend upgrading the site rather than copying courses. Your friend, and the site's users, need to know that Moodle will look different and some things will work differently, the site is moving through eight years of development. Notably any theme or branding used by the site won't survive the upgrade. You may want to evaluate some popular themes as alternatives.

I agree with Visvanath about the plugins. I'd start by finding out which are definitely not in use, both Manage Activities and Manage Blocks show the number of times this plugin type is used. Also find out which plugins are compatible with the target version and exclude those. Some may have become "core" plugins and are now part of Moodle. Additional plugins are third party code and may have their own additional upgrade steps.

Consider Moodle 3.9 as the target version, this is the current long-term support version, supported till 2023, a year longer than Moodle 3.10.

(I wrote a blog post about this).

In reply to Leon Stringer

Re: Migrating Server and Updating Moodle from 2.4 to 3.6+

by John Nichols -
Thank you, Leon and Emma! I was wondering if the bulk of these plugins were standard, but I wasn't sure how to tell. Sounds like Manage Activities and Manage Blocks will be helpful tools.

Emma, yes, that was my plan to wait to move servers until after 3.6. I'm looking into when I'll need to upgrade PHP and hopefully will be able to just do it once or twice more before moving to the new server.

Leon, thank you for your recommendations. We'll shoot for 3.9 and I'll let the owner and users know it will look different. We don't have a lot of resources at our fingertips to setup interum servers or VM's but DigitalOcean looks like a good option if that is needed. Although, I hope it's not necessary.
In reply to John Nichols

Re: Migrating Server and Updating Moodle from 2.4 to 3.6+

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers

With 2.4 Site administration ▸ Plugins ▸ Plugin overview should have a Show add-ons only link to see only non-standard plugins.

Average of ratings: Useful (1)
In reply to John Nichols

Re: Migrating Server and Updating Moodle from 2.4 to 3.6+

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers
Thanks for the link Leon - wasn't sure if it was available in 2.6. I always get my filtered list and have it handy for every upgrade I do so as not to forget any plugins. Ken is right, make sure you download the appropriate plugin version for each step in the upgrade path. The theme is a big one, I would suggest setting up a theme in a 3.9 version so that you can then just replicate it once upgraded. 2.6 to 3.9 shouldn't be too bad - asides from themes, you are past most of the huge changes (file structure, quiz changes, assignment rewrite etc.) that happened earlier in moodle's life cycle.
In reply to Emma Richardson

Re: Migrating Server and Updating Moodle from 2.4 to 3.6+

by John Nichols -
Thank you again, Emma and Leon. I'll look at the plugin overview once 2.4.11 is done installing. Seems to be taking quite some time... If the install takes hours and then I need to do another backup in between each that takes hours (it took me 5 hours to download the last backup), I'm worried about how long this is going to take. They need to have their school back up in a few days.

I'm so glad to hear that I'm past most the huge changes. Is there a theme that can be chosen that will work for all these versions? I don't know how important the look of the theme is to this school, except that it looks clean and professional.
In reply to John Nichols

Re: Migrating Server and Updating Moodle from 2.4 to 3.6+

by Ken Task -
Picture of Particularly helpful Moodlers

Clean up plugins first!!!  Remove plugins not used for sure.

Research plugins for compatibillity for destination version of Moodle core.  Some plugins may no longer be moving forward.

One item to remember in that regard ... themes are plugins ... so as you march the moodle upwards, themes will change ... best to use a standard stock theme that came with core or will come with core upgrades.

You could lease a staging server - maybe not at SiteGround - that's a minimal install of a Linux OS, thus be able to build php version, mysql versions as high as possible for the transfer of the 2.4 site to staging.   Would have to have enough space ... you've not mentioned how large moodledata is.

Then using git, side load git acquired code for 2,5,highest to begin the march.   That would result in a one hop upgrade ... but now the instance is under git and easily marched a version at a time or strategic hyperjumping.

The other route ... make full backups of all 300+ courses.  Download all or transfer to new server data where

In the newly hosted SiteGround instance that has a 3.9.highest already installed but minimal moodle + all the plugins.   One test course to assure plugins are working.   Now the biggy ...

Build the shell of categories for the site ... no courses in the categories.

The biggy ... use command line moosh to restore course backups in bulk to a category - cat created in advance.

Something to share about SiteGround ... they have their hardware/apps on Google ... but provide customers with their own SiteGround programmed panel (like cPanel).  While that sounds like an advantage, it also might be something that falls short in migration and/or in maintenance after the migration.

I'll be so bold as to say command line access to new server as well as superuser creds to DB server is more than desired.

'SoS', Ken


In reply to Ken Task

Re: Migrating Server and Updating Moodle from 2.4 to 3.6+

by John Nichols -
Hi, Ken. These are good things to consider... thanks for your response!

So about the moodledata size... I should have asked this earlier but forgot. I don't see a folder called moodledata on my server. There is one that is pointed to from within the Moodle install folder that is named after the school 'IFTA', and I assumed that it is the moodledata folder. It's 32Mb and has a bunch of .php files in it. I'll link to a pic of it and maybe you can tell me if that is the folder or not? https://ibb.co/NVwtGc1

In the config.php file within the Moodle folder there is this a line "$CFG->dataroot = '/var/www/html/moodle';" But that folder referenced is the Moodle code, correct? It's 37Gb and here is a screenshot of some of the folders within: https://ibb.co/wRfmdjn
In reply to John Nichols

Re: Migrating Server and Updating Moodle from 2.4 to 3.6+

by Ken Task -
Picture of Particularly helpful Moodlers

moodledata is what it's typically called ... it could be called anything ... but it has to be accessible by Moodle code.

The dataroot variable in config.php should point to it.

I do see in second screen shot an aliased directory: an 'ifta'

What does ls -l ifta show?

I don't have a version 2 to look at ... here's what's in a 3.9.highest at present:

cache    geoip  localcache  muc         sessions  trashdir
filedir  lang   models      repository  temp

Yours probably doesn't have some of above, but the one that is absolutely necessary is 'filedir'.

That directory contains a 'warning.txt' file ... maybe to a find for that file to see where it's located.

Looks like:

00  0f  1e  2d  3c  4b  5a  69  78  87  96  a5  b4  c3  d2  e1  f0  ff
01  10  1f  2e  3d  4c  5b  6a  79  88  97  a6  b5  c4  d3  e2  f1  warning.txt
02  11  20  2f  3e  4d  5c  6b  7a  89  98  a7  b6  c5  d4  e3  f2
03  12  21  30  3f  4e  5d  6c  7b  8a  99  a8  b7  c6  d5  e4  f3
04  13  22  31  40  4f  5e  6d  7c  8b  9a  a9  b8  c7  d6  e5  f4
05  14  23  32  41  50  5f  6e  7d  8c  9b  aa  b9  c8  d7  e6  f5
06  15  24  33  42  51  60  6f  7e  8d  9c  ab  ba  c9  d8  e7  f6
07  16  25  34  43  52  61  70  7f  8e  9d  ac  bb  ca  d9  e8  f7
08  17  26  35  44  53  62  71  80  8f  9e  ad  bc  cb  da  e9  f8
09  18  27  36  45  54  63  72  81  90  9f  ae  bd  cc  db  ea  f9
0a  19  28  37  46  55  64  73  82  91  a0  af  be  cd  dc  eb  fa
0b  1a  29  38  47  56  65  74  83  92  a1  b0  bf  ce  dd  ec  fb
0c  1b  2a  39  48  57  66  75  84  93  a2  b1  c0  cf  de  ed  fc
0d  1c  2b  3a  49  58  67  76  85  94  a3  b2  c1  d0  df  ee  fd
0e  1d  2c  3b  4a  59  68  77  86  95  a4  b3  c2  d1  e0  ef  fe

Other than the .txt file referenced above there is nothing humanly readable in there!

Since you have CLI and moosh, I'll send you a little plugin checker for your 2.4.x site to run from admin/cli/ of code in next posting.

'SoS', Ken




In reply to Ken Task

Re: Migrating Server and Updating Moodle from 2.4 to 3.6+

by John Nichols -
Thank you again, Ken. Yes, a folder named FileDir with what you described is located within the /var/www/html/moodle folder (although now I've renamed the Moodle folder since I am installing the next version of Moodle and I didn't want this folder to be overwritten). Does that mean it is the MoodleData folder or is it the code folder, or both combined??

Here's what's inside IFTA and below this another folder within the IFTA folder titled HTML:
[root@CIFTA-Moodle02 home]# ls -l ifta
total 295112
-rw-r--r--. 1 root root 133739777 Jan 5 09:19 dump-fixed.sql
-rw-r--r--. 1 root root 133739755 Jan 5 08:57 dump.sql
drwxr-xr-x. 6 ifta ifta 8192 Jan 4 2018 html
-rw-rw-r--. 1 ifta ifta 8147522 Nov 16 2017 ifta_code_20171117.tgz
-rw-rw-r--. 1 ifta ifta 8149235 Jan 4 2018 ifta_code_201800103.tgz
-rw-rw-rw-. 1 ifta ifta 150146 Jan 3 02:38 IFTA.log
drwxr-xr-x. 2 ifta ifta 155 Aug 8 2008 menugen
-rw-r--r--. 1 root root 18241903 Jan 5 07:50 moodle-database.sql.gz

[root@CIFTA-Moodle02 home]# cd /home/ifta/
[root@CIFTA-Moodle02 ifta]# ls -l html
total 1640
-rw-r--r--. 1 ifta ifta 1964 Aug 18 2008 addcgrouptoprog.php
-rw-r--r--. 1 ifta ifta 3133 Aug 18 2008 addclass2.php
-rw-r--r--. 1 ifta ifta 3474 Aug 18 2008 addclass.php
-rw-r--r--. 1 ifta ifta 4057 Aug 18 2008 addcontact2.php
-rw-r--r--. 1 ifta ifta 1493 Aug 18 2008 addcontact.php
-rw-r--r--. 1 ifta ifta 3081 Aug 18 2008 addcourse2.php
-rw-r--r--. 1 ifta ifta 3081 Aug 18 2008 addcoursegroup2.php
-rw-r--r--. 1 ifta ifta 1188 Aug 18 2008 addcoursegroup.php
-rw-r--r--. 1 ifta ifta 1417 Aug 18 2008 addcourse.php
-rw-r--r--. 1 ifta ifta 1150 Aug 18 2008 addcoursetogroup2.php
-rw-r--r--. 1 ifta ifta 4112 Aug 18 2008 addcoursetogroup.php
-rw-r--r--. 1 ifta ifta 3210 Aug 18 2008 adddepartment2.php
-rw-r--r--. 1 ifta ifta 1425 Aug 18 2008 adddepartment.php
-rw-r--r--. 1 ifta ifta 2708 Aug 18 2008 addgradebook2.php
-rw-r--r--. 1 ifta ifta 3261 Dec 22 2011 addgradebook.php
-rw-r--r--. 1 ifta ifta 1984 Aug 18 2008 addholiday2.php
-rw-r--r--. 1 ifta ifta 2135 Nov 16 2017 addholiday.php
-rw-r--r--. 1 ifta ifta 106 Aug 18 2008 addleft.gif
-rw-r--r--. 1 ifta ifta 1435 Aug 18 2008 addmeetingexception.php
-rw-r--r--. 1 ifta ifta 2573 Aug 18 2008 addpageacl.php
-rw-r--r--. 1 ifta ifta 3181 Aug 18 2008 addpagedesc2.php
-rw-r--r--. 1 ifta ifta 1323 Aug 18 2008 addpagedesc.php
-rw-r--r--. 1 ifta ifta 3457 Aug 18 2008 addperiod2.php
-rw-r--r--. 1 ifta ifta 1341 Aug 18 2008 addperiod.php
-rw-r--r--. 1 ifta ifta 3156 Aug 18 2008 addprogram2.php
-rw-r--r--. 1 ifta ifta 1347 Aug 18 2008 addprogram.php
-rw-r--r--. 1 ifta ifta 105 Aug 18 2008 addright.gif
-rw-r--r--. 1 ifta ifta 3492 Aug 18 2008 addstudent2.php
-rw-r--r--. 1 ifta ifta 1304 Aug 18 2008 addstudent.php
-rw-r--r--. 1 ifta ifta 1914 Aug 18 2008 addtransev2.php
-rw-r--r--. 1 ifta ifta 4360 Aug 18 2008 addtransev.php
-rw-r--r--. 1 ifta ifta 2502 Aug 18 2008 adduser2.php
-rw-r--r--. 1 ifta ifta 4681 Aug 18 2008 adduser.php
-rw-r--r--. 1 ifta ifta 2233 Jan 4 2018 alternatecourse2.php
-rw-r--r--. 1 ifta ifta 4428 Aug 18 2008 alternatecourse.php
-rw-r--r--. 1 ifta ifta 6062 Aug 18 2008 attendancesheet.php
-rw-r--r--. 1 ifta ifta 1033 Aug 18 2008 backup.php
-rw-r--r--. 1 ifta ifta 110 Aug 18 2008 c.gif
-rw-r--r--. 1 ifta ifta 1681 Aug 18 2008 changeassignment.php
-rw-r--r--. 1 ifta ifta 1563 Aug 18 2008 changedates2.php
-rw-r--r--. 1 ifta ifta 484 Aug 18 2008 ChangeMyPassword.php
-rw-r--r--. 1 ifta ifta 1352 Aug 18 2008 changeperiod2.php
-rw-r--r--. 1 ifta ifta 2669 Aug 18 2008 changeperiod.php
-rw-r--r--. 1 ifta ifta 58316 Aug 18 2008 class.ezpdf.php
-rw-r--r--. 1 ifta ifta 5150 Jan 4 2018 classgrades2.php
-rw-r--r--. 1 ifta ifta 10740 Aug 18 2008 classgrades.php
-rw-r--r--. 1 ifta ifta 103507 Aug 18 2008 class.pdf.php
-rw-r--r--. 1 ifta ifta 451 Jun 4 2015 config.php
-rw-r--r--. 1 ifta ifta 1808 Aug 18 2008 converttostudent2.php
-rw-r--r--. 1 ifta ifta 1429 Aug 18 2008 converttostudent.php
-rw-r--r--. 1 ifta ifta 219 Aug 18 2008 corner.png
-rw-r--r--. 1 ifta ifta 1318 Aug 18 2008 deleteassignment.php
-rw-r--r--. 1 ifta ifta 92 Aug 18 2008 delete.gif
-rw-r--r--. 1 ifta ifta 4664 Aug 18 2008 DHTMLpos.js
-rw-r--r--. 1 ifta ifta 1452 Aug 18 2008 dropgradebook.php
-rw-r--r--. 1 ifta ifta 2399 Jan 4 2018 editclass2.php
-rw-r--r--. 1 ifta ifta 9073 Nov 16 2017 editclass.php
-rw-r--r--. 1 ifta ifta 2577 Jan 4 2018 editcontact2.php
-rw-r--r--. 1 ifta ifta 3725 Aug 18 2008 editcontact.php
-rw-r--r--. 1 ifta ifta 2404 Jan 4 2018 editcourse2.php
-rw-r--r--. 1 ifta ifta 2481 Jan 4 2018 editcoursegroup2.php
-rw-r--r--. 1 ifta ifta 3592 Aug 18 2008 editcoursegroup.php
-rw-r--r--. 1 ifta ifta 4183 Aug 18 2008 editcourse.php
-rw-r--r--. 1 ifta ifta 2420 Jan 4 2018 editdepartment2.php
-rw-r--r--. 1 ifta ifta 3558 Aug 18 2008 editdepartment.php
-rw-r--r--. 1 ifta ifta 2517 Aug 18 2008 editgradebook.php
-rw-r--r--. 1 ifta ifta 2587 Jan 4 2018 editholiday2.php
-rw-r--r--. 1 ifta ifta 2534 Nov 16 2017 editholiday.php
-rw-r--r--. 1 ifta ifta 2601 Jan 4 2018 editpageacl2.php
-rw-r--r--. 1 ifta ifta 3612 Aug 18 2008 editpageacl.php
-rw-r--r--. 1 ifta ifta 2510 Jan 4 2018 editpagedesc2.php
-rw-r--r--. 1 ifta ifta 2675 Aug 18 2008 editpagedesc.php
-rw-r--r--. 1 ifta ifta 3264 Jan 4 2018 editperiod2.php
-rw-r--r--. 1 ifta ifta 2569 Aug 18 2008 editperiod.php
-rw-r--r--. 1 ifta ifta 2880 Jan 4 2018 editprogram2.php
-rw-r--r--. 1 ifta ifta 4901 Nov 16 2017 editprogramcgroups.php
-rw-r--r--. 1 ifta ifta 3286 Aug 18 2008 editprogram.php
-rw-r--r--. 1 ifta ifta 3244 Jan 4 2018 editstudent2.php
-rw-r--r--. 1 ifta ifta 3119 Jan 4 2018 editstudentdata2.php
-rw-r--r--. 1 ifta ifta 4818 Aug 18 2008 editstudentdata.php
-rw-r--r--. 1 ifta ifta 4675 Aug 18 2008 editstudent.php
-rw-r--r--. 1 ifta ifta 5260 Aug 18 2008 figuregpas.php
drwxr-xr-x. 3 ifta ifta 4096 Aug 18 2008 fonts
-rw-r--r--. 1 ifta ifta 1278 Aug 18 2008 getfinalaverages.php
-rw-r--r--. 1 ifta ifta 884 Aug 18 2008 getgcolumn.php
-rw-r--r--. 1 ifta ifta 879 Aug 18 2008 getgentry.php
-rw-r--r--. 1 ifta ifta 4396 Aug 18 2008 gradebookaspdf.php
-rw-r--r--. 1 ifta ifta 5477 Aug 18 2008 gradesheet.php
drwxr-xr-x. 4 ifta ifta 91 Aug 18 2008 images
-rw-r--r--. 1 ifta ifta 49 Aug 18 2008 index.php
-rw-r--r--. 1 ifta ifta 17 Aug 18 2008 info.php
-rw-r--r--. 1 ifta ifta 84 Aug 18 2008 l.gif
-rw-r--r--. 1 ifta ifta 2278 Aug 18 2008 lockclasses.php
-rw-r--r--. 1 ifta ifta 807 Jun 4 2015 login2.php
-rw-r--r--. 1 ifta ifta 1232 Aug 18 2008 login.php
-rw-r--r--. 1 ifta ifta 548 Aug 18 2008 logout.php
-rw-r--r--. 1 ifta ifta 6107 Apr 15 2009 lookupcontact2.php
-rw-r--r--. 1 ifta ifta 1839 Aug 18 2008 lookupcontact.php
-rw-r--r--. 1 ifta ifta 8225 Nov 16 2017 lookupstudent2.php
-rw-r--r--. 1 ifta ifta 2005 Aug 18 2008 lookupstudent.php
-rw-r--r--. 1 ifta ifta 4736 Aug 18 2008 menu.php
-rw-r--r--. 1 ifta ifta 3156 Jan 4 2018 modifystgrades2.php
-rw-r--r--. 1 ifta ifta 6922 Nov 16 2017 modifystgrades.php
-rw-r--r--. 1 ifta ifta 106 Aug 18 2008 moveleft.gif
-rw-r--r--. 1 ifta ifta 106 Aug 18 2008 moveright.gif
drwxr-xr-x. 3 ifta ifta 138 Apr 15 2009 Pager
drwxr-xr-x. 3 ifta ifta 85 Aug 18 2008 pdf
-rw-r--r--. 1 ifta ifta 12434 Aug 18 2008 pdftrans.php
-rw-r--r--. 1 ifta ifta 112 Aug 18 2008 p.gif
-rw-r--r--. 1 ifta ifta 8008 Aug 18 2008 promoteall.php
-rw-r--r--. 1 ifta ifta 126127 Aug 18 2008 prototype-1.6.0.2.js
lrwxrwxrwx. 1 ifta ifta 20 Jun 4 2015 prototype.js -> prototype-1.6.0.2.js
-rw-rw-r--. 1 ifta ifta 412 Nov 16 2017 q
-rw-r--r--. 1 ifta ifta 9706 Aug 18 2008 rcompleted.php
-rw-r--r--. 1 ifta ifta 6942 Aug 18 2008 recalcallstandings.php
-rw-r--r--. 1 ifta ifta 4334 Aug 18 2008 recalcgpa.php
-rw-r--r--. 1 ifta ifta 7057 Aug 18 2008 recalcstand.php
-rw-r--r--. 1 ifta ifta 2718 Aug 18 2008 regclass.php
-rw-r--r--. 1 ifta ifta 9019 Aug 18 2008 registerall.php
-rw-r--r--. 1 ifta ifta 9294 Aug 18 2008 regnextlevel.php
-rw-r--r--. 1 ifta ifta 1052 Aug 18 2008 reimportstudentstogradebook.php
-rw-r--r--. 1 ifta ifta 1382 Aug 18 2008 removecgroupfromprog.php
-rw-r--r--. 1 ifta ifta 2474 Aug 18 2008 removeclass.php
-rw-r--r--. 1 ifta ifta 3846 Aug 18 2008 removecoursegroup.php
-rw-r--r--. 1 ifta ifta 7445 Aug 18 2008 removecourse.php
-rw-r--r--. 1 ifta ifta 5074 Aug 18 2008 removedepartment.php
-rw-r--r--. 1 ifta ifta 1209 Aug 18 2008 removeholiday.php
-rw-r--r--. 1 ifta ifta 1438 Aug 18 2008 removemeetingexception.php
-rw-r--r--. 1 ifta ifta 2077 Aug 18 2008 removepageacl.php
-rw-r--r--. 1 ifta ifta 2051 Aug 18 2008 removepagedesc.php
-rw-r--r--. 1 ifta ifta 3604 Aug 18 2008 removeperiod.php
-rw-r--r--. 1 ifta ifta 4783 Aug 18 2008 removeprogram.php
-rw-r--r--. 1 ifta ifta 1539 Aug 18 2008 removetranev.php
-rw-r--r--. 1 ifta ifta 3360 Aug 18 2008 report.css
-rw-r--r--. 1 ifta ifta 5832 Aug 18 2008 rexcessabsences.php
-rw-r--r--. 1 ifta ifta 5840 Aug 18 2008 rfailures.php
-rw-r--r--. 1 ifta ifta 113 Aug 18 2008 r.gif
-rw-r--r--. 1 ifta ifta 11908 Aug 18 2008 rgradereport.php
-rw-r--r--. 1 ifta ifta 5846 Aug 18 2008 rincompletes.php
-rw-r--r--. 1 ifta ifta 6016 Aug 18 2008 rnogrades.php
-rw-r--r--. 1 ifta ifta 12408 Aug 18 2008 rofficialtranscript2.php
-rw-r--r--. 1 ifta ifta 12432 May 5 2012 rofficialtranscript.php
-rw-r--r--. 1 ifta ifta 5605 Aug 18 2008 ropenclasses.php
-rw-r--r--. 1 ifta ifta 1200 Aug 18 2008 rranks.php
-rw-r--r--. 1 ifta ifta 7857 Aug 18 2008 rsregistered.php
-rw-r--r--. 1 ifta ifta 7424 Aug 18 2008 rstudcourse.php
-rw-r--r--. 1 ifta ifta 1801 Aug 18 2008 schoolerrors.php
-rw-r--r--. 1 ifta ifta 15789 Aug 18 2008 setinstaccess.php
-rw-r--r--. 1 ifta ifta 1239 Aug 18 2008 setminaccess.php
-rw-r--r--. 1 ifta ifta 1230 Aug 18 2008 setstudaccess.php
-rw-r--r--. 1 ifta ifta 483 Aug 18 2008 showactive.php
-rw-r--r--. 1 ifta ifta 2906 Aug 18 2008 showapagedesc.php
-rw-r--r--. 1 ifta ifta 8660 Apr 15 2009 showclasses.php
-rw-r--r--. 1 ifta ifta 5849 Aug 18 2008 showclass.php
-rw-r--r--. 1 ifta ifta 12350 Aug 18 2008 showcontact.php
-rw-r--r--. 1 ifta ifta 480 Aug 18 2008 showcontacts.php
-rw-r--r--. 1 ifta ifta 8471 Aug 18 2008 showcoursegroups.php
-rw-r--r--. 1 ifta ifta 5314 Aug 18 2008 showcourse.php
-rw-r--r--. 1 ifta ifta 5337 Apr 15 2009 showcourses.php
-rw-r--r--. 1 ifta ifta 4156 Aug 18 2008 showdepartment.php
-rw-r--r--. 1 ifta ifta 3956 Aug 18 2008 showdepartments.php
-rw-r--r--. 1 ifta ifta 4004 Nov 16 2017 showholidays.php
-rw-r--r--. 1 ifta ifta 485 Aug 18 2008 showinactive.php
-rw-r--r--. 1 ifta ifta 5173 Aug 18 2008 showpageacl.php
-rw-r--r--. 1 ifta ifta 3474 Aug 18 2008 showpagedesc.php
-rw-r--r--. 1 ifta ifta 3373 Aug 18 2008 showperiods.php
-rw-r--r--. 1 ifta ifta 4437 Aug 18 2008 showprogram.php
-rw-r--r--. 1 ifta ifta 3940 Aug 18 2008 showprograms.php
-rw-r--r--. 1 ifta ifta 12332 Aug 18 2008 showstudentdata.php
-rw-r--r--. 1 ifta ifta 12208 Aug 18 2008 showstudent.php
-rw-r--r--. 1 ifta ifta 480 Aug 18 2008 showstudents.php
-rw-r--r--. 1 ifta ifta 3620 Aug 18 2008 showusers.php
-rw-r--r--. 1 ifta ifta 9755 Aug 18 2008 studentgrades.php
-rw-r--r--. 1 ifta ifta 13985 Aug 18 2008 studentregistration.php
-rw-r--r--. 1 ifta ifta 6001 Aug 18 2008 studenttransev.php
-rw-r--r--. 1 ifta ifta 2455 Aug 18 2008 studentyears2.php
-rw-r--r--. 1 ifta ifta 2936 Aug 18 2008 studentyears.php
-rw-r--r--. 1 ifta ifta 4227 Aug 18 2008 studoper.php
-rw-r--r--. 1 ifta ifta 2464 Aug 18 2008 switchadminpriv.php
-rw-r--r--. 1 ifta ifta 10590 Aug 18 2008 SYSauthorize.php
-rw-r--r--. 1 ifta ifta 13725 Jun 4 2015 SYSdbfuncs.php
-rw-r--r--. 1 ifta ifta 3173 Aug 18 2008 SYSerror.php
-rw-r--r--. 1 ifta ifta 15304 Jan 4 2018 SYSformgen.php
-rw-r--r--. 1 ifta ifta 88337 May 8 2010 SYSgradebook.php
-rw-r--r--. 1 ifta ifta 7098 Aug 18 2008 SYSmeetingSpec.php
-rw-r--r--. 1 ifta ifta 14380 Aug 18 2008 SYSmenu2.php
-rw-r--r--. 1 ifta ifta 15583 Aug 18 2008 SYSmenus.php
-rw-r--r--. 1 ifta ifta 4317 Aug 18 2008 SYSmeta.php
-rw-r--r--. 1 ifta ifta 7504 Aug 18 2008 SYSpageheader.php
-rw-r--r--. 1 ifta ifta 2342 Aug 18 2008 SYSspreadsheet.php
-rw-r--r--. 1 ifta ifta 1691 Aug 18 2008 SystemBackup2.php
-rw-r--r--. 1 ifta ifta 1203 Aug 18 2008 SystemBackup3.php
-rw-r--r--. 1 ifta ifta 3328 Nov 16 2017 SystemBackup.php
-rw-r--r--. 1 ifta ifta 8044 Aug 18 2008 template2.css
-rw-r--r--. 1 ifta ifta 12472 Aug 18 2008 template.css
-rw-r--r--. 1 ifta ifta 2139 Aug 18 2008 togglegbstudentlock.php
-rw-r--r--. 1 ifta ifta 12434 Aug 18 2008 transcript_as_pdf.php
-rw-r--r--. 1 ifta ifta 4899 Aug 18 2008 transcript.css
-rw-r--r--. 1 ifta ifta 1371 Aug 18 2008 transferbooktotranscripts.php
-rw-r--r--. 1 ifta ifta 64 Aug 18 2008 transparent.gif
-rw-r--r--. 1 ifta ifta 1943 Aug 18 2008 unregclass.php
-rw-r--r--. 1 ifta ifta 2621 Aug 18 2008 updateccurve.php
-rw-r--r--. 1 ifta ifta 1187 Aug 18 2008 updateclassdays.php
-rw-r--r--. 1 ifta ifta 3196 Aug 18 2008 updateclocks.php
-rw-r--r--. 1 ifta ifta 2790 Aug 18 2008 updatecpenalties.php
-rw-r--r--. 1 ifta ifta 2631 Aug 18 2008 updatecrange.php
-rw-r--r--. 1 ifta ifta 1495 Aug 18 2008 updategbookdrops.php
-rw-r--r--. 1 ifta ifta 1862 Aug 18 2008 updategentry.php
-rw-r--r--. 1 ifta ifta 3130 Aug 18 2008 updategstuff.php
-rw-r--r--. 1 ifta ifta 8142 Aug 18 2008 useraccess.php
-rw-r--r--. 1 ifta ifta 4512 Aug 18 2008 userpassword2.php
-rw-r--r--. 1 ifta ifta 4000 Aug 18 2008 userpassword.php
-rw-r--r--. 1 ifta ifta 3160 Aug 18 2008 userremove.php
-rw-r--r--. 1 ifta ifta 3887 Apr 15 2009 vtext.php
-rw-r--r--. 1 ifta ifta 1911 Aug 18 2008 welcome.php
In reply to John Nichols

Re: Migrating Server and Updating Moodle from 2.4 to 3.6+

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers
This is not anything that you would find in Moodle. You cannot just rename the existing moodle folder as your website will not longer be accessible. If you are ok with the site offline for a while, then that is fine. As Leon mentioned, you need to find out if you have something else integrated with moodle - that will cause issues...
In reply to Emma Richardson

Re: Migrating Server and Updating Moodle from 2.4 to 3.6+

by John Nichols -
Thank you both. Yes, no one is planning to use the site for a few days and it's okay for it to be offline. I plan to bring it back once the install is done. At that point can I separate the Moodle install from the MoodleData which was mixed in before? I don't know if that was intentional but I assume it wasn't. Also, do you know how I can tell if something is integrated with Moodle?
In reply to John Nichols

Re: Migrating Server and Updating Moodle from 2.4 to 3.6+

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers

"do you know how I can tell if something is integrated with Moodle?" – If it's external to Moodle's plugin architecture then you can't. If you're lucky the site owner will know if it's in use and exactly what it does. Otherwise it's a case of removing (or inadvertently breaking) the functionality and seeing if anyone complains.

In reply to Leon Stringer

Re: Migrating Server and Updating Moodle from 2.4 to 3.6+

by John Nichols -
Thanks! I found out the IFTA folder is a separate little website for the admin to keep track of student data like transcripts. Thankfully it's not attached to Moodle so shouldn't have any issues as long as I can make sure it can reference itself after I migrate it to the new server.

Moodle 2.4.11 is still installing. Ken Task sent me instructions on how to compare the contents of the old Moodle folder to what is normally included in Moodle 2.4 in order to determine which files and folders may belong in the MoodleData folder. I'll use this info to separate them and point the config.php file to the MoodleData folder I'll create.

Is there any place y'all would recommend I place the MoodleData folder?
In reply to John Nichols

Re: Migrating Server and Updating Moodle from 2.4 to 3.6+

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers
Very quickly, the moodledata should not be in any "web" public folder.

On my server (VPS), the path to my public internet folder is /home/username/public_html. So the moodledata folder should not be at /home/username/public_html/moodledata, and instead should be at /home/username/moodledata, which I describe as "one level up from public." On some servers, this public folder might be called www, htdocs, or something else. My website's homepage, just for reference, is at /home/username/public_html/index.html. (Of course, Internet users only see index.html and don't see the path to it.)

When I create the moodledata folder, I always "chmod 777 moodledata" via ssh, but there are also ways to change the permissions on this folder.  I forget if 777 is best, or 755, but others here on moodle.org will correct me if I am wrong.  If you have moved your moodledata folder, then the command is "chmod 777 -R moodledata," which applies the 777 recursively.

Also, there is nothing unique about calling this moodledata folder "moodledata."  It can be any name, but it has to match what your "config.php" file, in you moodle folder, is using.  On my Moodle, I call mine moodledata3 to reflect that this folder is what I have used starting with Moodle 3.0.  I will probably start from scratch when Moodle 4 is release later this year, so my folder name will probably be moodledata4.


Average of ratings: Useful (1)
In reply to Rick Jerz

Re: Migrating Server and Updating Moodle from 2.4 to 3.6+

by John Nichols -
Thanks for this information. I was able to separate the MoodleData from the Moodle folder and put the newly created MoodleData folder in /var/. The Moodle folder is in var/www/html/.

I updated the config.php file to match, and did not have any issues.
In reply to John Nichols

Re: Migrating Server and Updating Moodle from 2.4 to 3.6+

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers

$CFG->dataroot = '/var/www/html/moodle' means that the Moodledata – with sub-folders cache, filedir, lang, muc, temp and trashdir – is mixed in with the Moodle source code folder. This is not a good idea as, unless additional steps have been taken, course and user files could be potentially be accessed by anyone on the Internet.

The ifta folder looks like a symlink (shortcut) within the Moodle source code folder and isn't part of Moodle. You'll need to investigate what this is. If there's code which integrates with Moodle and it's still in use then the work may be more complicated.

In reply to Leon Stringer

Re: Migrating Server and Updating Moodle from 2.4 to 3.6+

by John Nichols -
Thanks, Leon. I responded to Emma some questions you may be able to answer. But also wanted to reference this, "Moodledata – with sub-folders cache, filedir, lang, muc, temp and trashdir – is mixed in..." Are there more folders to MoodleData I need to look out for, or can I separate these into their own MoodleData folder and update the config.php file to point to it?
In reply to John Nichols

Re: Migrating Server and Updating Moodle from 2.4 to 3.6+

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers

The sub-folders I listed are all the Moodledata ones for a default Moodle 2.4 site, although lang conflicts with a source code folder so there may be a mix of data files and source code in there.

In fact filedir is the only folder you normally need, the other Moodledata folders contain data that can be regenerated if not present. I say "normally need" as one can configure additional items to be stored in Moodledata. There's no easy way to determine if this is the case but as long as you've got a backup of the original folder you should be able to copy across files that you find are missing.

If the site had been upgraded from an older version (Moodle 1.9 I think) then it's possible that there could be Moodledata files using the old layout with numbered names (e.g. 1/, 5/, 77/) but I don't see that in your screenshot.

In reply to John Nichols

Re: Migrating Server and Updating Moodle from 2.4 to 3.6+

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers
To answer this - yes, you could move filedir to a separate folder called moodledata or something else if you want and then direct the config.php file to that folder..did you get through the first install? It seemed to be taking far too long...
In reply to Emma Richardson

Re: Migrating Server and Updating Moodle from 2.4 to 3.6+

by John Nichols -
Thanks Emma and Leon. I've gotten the moodledata folder sorted out now.

As far as the first install, I was having an issue with Git and didn't realize it. I thought it was installing but it wasn't. Basically wasted the whole afternoon waiting on it when it wasn't even happening. When I realized what was going on, I did a bit more research into installing with Git and was able to get it to work.

Only trouble is, before doing this, I uninstalled the Plugins and associated tables that had been disabled and not used (based off what I saw in the Manage Activities and Manage Blocks area). I thought this may help Moodle with updates even though they were not add-ons but standard to Moodle 2.4 (there are no add-ons installed in this Moodle). The Admin panel then gave me a notification saying those plugins needed to be installed again. But I ignored this, assuming they would be installed with the upgrade. When I finally got Git working and the Admin panel was showing that it was ready to upgrade the software, it said it would install those missing plugins.

But then when I told it to install, there was an error (pasted below). So now I am restoring my backup and starting over again to get to the point before I uninstalled the plugins. I am hoping that will solve the problem.

Here's the error I received when upgrading:

Debug info: Table 'moodle.mdl_wiki' doesn't exist
UPDATE mdl_tag_instance
SET component = 'mod_wiki',
contextid = (SELECT ctx.id
FROM mdl_context ctx
JOIN mdl_course_modules cm
ON cm.id = ctx.instanceid
JOIN mdl_modules m
ON m.id = cm.module
JOIN mdl_wiki w
ON w.id = cm.instance
JOIN mdl_wiki_subwikis sw
ON sw.wikiid = w.id
JOIN mdl_wiki_pages wp
ON wp.subwikiid = sw.id
WHERE m.name = 'wiki'
AND ctx.contextlevel = ?
AND wp.id = mdl_tag_instance.itemid)
WHERE itemtype = 'wiki_pages' AND contextid IS NULL
[array (
0 => 70,
)]
Error code: dmlwriteexception



Stack trace:
line 446 of /lib/dml/moodle_database.php: dml_write_exception thrown
line 974 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
line 3313 of /lib/db/upgrade.php: call to mysqli_native_moodle_database->execute()
line 1560 of /lib/upgradelib.php: call to xmldb_main_upgrade()
line 361 of /admin/index.php: call to upgrade_core()
In reply to John Nichols

Re: Migrating Server and Updating Moodle from 2.4 to 3.6+

by Ken Task -
Picture of Particularly helpful Moodlers

Tip ... never un-install core mods or blocks.  If not going to use or they are not used anywhere in the site, simply hide them.

It's the *additional* mods/blocks/theme one need to focus upon.

From url line of moodle when logged on as admin level:

admin/plugins.php?updatesonly=0&contribonly=1

Site administration -> Plugins -> Plugins overview
Additional Plugins

That script I shared on checking plugins ... you had to create a .txt file of those addon shortnames.   Mind sharing that .txt file here?

Also, you said you had issues with git ... figured it out.

Your current code was probably not installed with git thus there is no hidden .git directory in the code directory.   The only way to use git with a code directory that wasn't installed with git is to do a side load.

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

With your 2.4, that should result in an update to the highest 2.4.11 code.

Check with ... while in code directory: fgrep '$release' version.php

While you are at the command line already to perform git update, why not use the admin/cli/upgrade.php script ... takes apache and CloudFlare out of the loop.   It's just php and your DB then.

Once the 2.4 has been updated, one could do the next hop to 2.5.highest by issuing 2 git commands in the code directory:

git branch --track MOODLE_25_STABLE origin/MOODLE_25_STABLE
git checkout MOODLE_25_STABLE

Then cd admin/cli/ ... php upgrade.php [ENTER]

Check site with web interface.   Working ok?

Do minimal backup - which is code + DB ... moodledata may not change in many updates.

Something like following when in the code directory:

tar -cvf /path/to/backuplocation/moodle-code-24x-$(date +%Y%m%d%-H%M%S).tar ../moodlecodedir;

mysqldump -u inseretuserhere -p'insertpassword here' insertmoodledbnamehere >
/path/to/backuplocation/moodle24x-db-$(date +%Y%m%d%-H%M%S).sql;

For minimal moodle data

tar -cvf /path/to/backuplocation/moodle-data-min-24x-$(date +%Y%m%d%-H%M%S).tar /path/to/moodledata/filedir;

In above 'x' is the point release ... 2411 highest in 2.4

Once you have a backup and checked site for function,  go forth again with next hop for the Moodle using git.

Sorta a 'wash, rinse, dry' ... do it again kinda thing.

If next hop fails, restore the backup you made just prior to git update/upgrade.   You are not loosing ground this way! smile

'SoS', Ken


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

Re: Migrating Server and Updating Moodle from 2.4 to 3.6+

by John Nichols -
Hi Ken,

Thanks again for your great advice. I have jumped the gun a bit because I was looking at the requirments for 2.7 and I was able to meet them without any checks. So I renamed my Moodle folder, created a fresh one, then used git to load the 2.7 files in. I had to follow directions I found here: https://moodle.org/mod/forum/discuss.php?d=210698

Namely:
"In your moodle directory:

git init
If you have any contributed plugins or other customizations now is the time to add their paths to .git/info/exclude so that they are excluded from git.

git remote add origin git://git.moodle.org/moodle.git
git fetch --all --prune
git branch --track MOODLE_27_STABLE origin/MOODLE_27_STABLE
git add .
git pull origin MOODLE_27_STABLE
git checkout MOODLE_27_STABLE
git branch -D master
(end)"

I then duplicated the config.php file over to the new moodle folder. Went to the Admin page and saw still no errors. Performed the upgrade with no issues. The owner and admin are now verifying everything is okay.

I'll follow your directions for backing up. BTW, the moodledata folder is 29Gb. Hopefully I will not have to back it up regularly, it takes quite some time, as the server gave me a space error previously and I had to back it up over the internet to my personal computer.
In reply to John Nichols

Re: Migrating Server and Updating Moodle from 2.4 to 3.6+

by John Nichols -
Also, Ken, I did not end up using the addons.txt file because there were only standard plugins installed. No Add-Ons so I didn't think it was necessary.

The admin and owner find no issues with the upgrade, so I'll move on to backing up and then the next hop to 3.1.
In reply to John Nichols

Re: Migrating Server and Updating Moodle from 2.4 to 3.6+

by John Nichols -
Ken, I followed your instructions and was able to backup the Moodle code and DB. I went ahead and tried the whole MoodleData folder and it gave me this error before finishing. tar: /var/moodle_back/moodle-data-min-24x-20210106210610.tar: Wrote only 6144 of 10240 bytes

Then I chose to only backup the two folders which were modified recently using 

tar -cvf /var/moodle_back/moodle-data-min-27x-$(date +%Y%m%d%-H%M%S).tar /var/moodledata/cache /var/moodledata/localcache;


In reply to John Nichols

Re: Migrating Server and Updating Moodle from 2.4 to 3.6+

by Ken Task -
Picture of Particularly helpful Moodlers

Interesting about how you used git ... that for later discussion.   But now the lastest ...

"I don't know why this happened, but possibly it ran out of space again?"

... again??!!! ... a little detail not shared up til now! :|   That's also why suggested minimal moodledata backup ... only filedir cause that's really all you need.

From command line: df -h

disk free space and show in human terms.

Looking for the partition (directory) where you are storing the backup tar ball.

On many systems, /var/ might not be the largest partition ... guessing that '/home/' might be.   But that all depends upon how restricted on is with current account setup.

Download then later to upload is never an efficient process for what you are doing ... especially when working with 29Gig! :|

This is a question for provider ... do they offer any attached storage where you could acquire and then mount on current server?   Many providers offer that ... yes, it cost, but you won't be needing using additional space for much longer.   Just large enough to hold at least 2 site backups ... and just long enough for when you can xfer to new server.

Think it would be difficult to mount something you had local on your PC ... besides, am also imagining it would be slow also!

IF provider doesn't provide any such thing ... alt would be SG data device? (ask them)   That's where you are moving anyway ... good test of tech support at SG, IMHO!

While they are checking on stuff ... you do also ... Site Admin, Server, Environment check - update the component.   In the drop downlist of moodle versions choose a version upwards by one version to see when things begin to show red - must fix - cannot upgrade to unless fixed.

Then you know for sure when to stop and work on xfer to new server and getting that to run ... the code directory you have now has hidden .git so you continue to use git with new SG system - if ya can ... if you have ssh access ... last I saw of a SG Panel there was not terminal icon and no info on how to connect to it via anything for ssh access.

You're gaining on it! smile

'SoS', Ken

In reply to Ken Task

Re: Migrating Server and Updating Moodle from 2.4 to 3.6+

by John Nichols -
Haha! Thanks, Ken. They are currently testing version 3.1.8. I have already used SFTP into the SG server, before I realized I would need to update Moodle on the old server.

Good idea to try the /home/ directory for backups. But yeah, I don't expect they'll be changing any of the data files until I am done with all the updates and on the new server. BTW, is there a way to tell the version that SG installs? I have whatever one they install by default using the "cpanel"-ish app. I don't want to point the DNS there yet though and not sure what the IP address would be. Can I look at a file in the directory to see which version it is?
In reply to John Nichols

Re: Migrating Server and Updating Moodle from 2.4 to 3.6+

by Ken Task -
Picture of Particularly helpful Moodlers

" .. a way to tell the version that SG installs ..." .... HUH?  You are doing a migration of the entire site.  You have been successful in using git to acquire upgraded core code and will be using git to update/upgrade site in future.   So why would you even consider what version of Moodle SG would install?    Do they have a Softac or other icon in their panel for installing a Moodle?

Ask SG support!!!!

Just how much do you 'trust' SG to upgrade the site?   And how do they do that?   Git?  Again ... Ask SG support!!!!

To see version ... ssh into SG server ... cd to code root, then issue:

fgrep '$release' version.php

'SoS', Ken

In reply to John Nichols

Re: Migrating Server and Updating Moodle from 2.4 to 3.6+

by Ken Task -
Picture of Particularly helpful Moodlers

You really don't need cache or localcache ... those will be rebuilt.

*only moodledata/filedir/

so if you are looking for anything new, only in filedir ... but your 'customer' ... and you shouldn't be uploading anything/using while checking the site.

Lucky you!   From:

https://www.siteground.com/cloud-hosting.htm

SSH & SFTP

Our free SSH is developed in-house to allow secure account-restricted access. It gives you an encrypted secure connection to your account to manage easily large files and even databases. It is especially useful to administrators and web developers looking to enable direct secure access to their hosting account on the web server. With SSH enabled, you can also take advantage of SFTP for secure file access, transfer and management.



So you could xfer your backups to the new SG server ... IF it has enough space using scp from old to new.

Something like (you may/may not need a -P ####### (portnumber):

scp -P ####### *.tar *.sql root@yournewserverIP:/path/to/uploadfolder/

From the location of where you saved the tar balls and sql dump for the moodle.

With above you would be prompted for password.

Going server to server will be faster than download and then turn around and upload.

Let's not forget the 'ifta' scripts when finally xfer ... and do be aware that these are Moodle forums ... not ifta ... whatever the heck that is/does! smile

'SoS', Ken

In reply to Ken Task

Re: Migrating Server and Updating Moodle from 2.4 to 3.6+

by John Nichols -
As an update, we are currently running Moodle 3.9.3 on the original server. All is well and I have backed it up and am currently transferring it to the new SiteGround server through SFTP using WinSCP. I couldn't have gotten this far without all of your help. Thank you all so much!

I have few more questions:

1. I'm looking at File Manager currently on SG (have not SSH into SG server yet using PuTTY, but I plan to do that soon). SG's install of Moodle had the code directories in the public_html folder, not within their own moodle folder in public_html. Is that how I too should setup Moodle? Or do y'all know if I can have a folder titled moodle within public_html?

2: I was planning to import the current MariaDB into a fresh MySQL DB on the SG server using phpMyAdmin. Then changing Moodle's config.php to match the new db name and user info. Is that the best way? If so, there is an option when importing to choose the character set of the file. I had to make this utf8mb4 at some point for upgrading Moodle. But I don't see that option to select when importing the db using phpMyAdmin, just utf-8. Suggestions?

Regarding Ken's questions/statements about SiteGround... you make good points again! SG does have an icon on their panel for installing Moodle, but the information attached to it and the interface is very limited. For some reason I hadn't thought that I would just be migrating the Moodle Code over, and not integrating the data and DB with SG's install. But since I have access to SSH, SFTP, and their server is running Fedora, I think I should be okay with circumnavigating their UI to manage Moodle. I assume all the commands will be similar if not the same on Fedora as RHEL. I can always look up what I need to do if things are different.

Thanks to everyone again!
In reply to John Nichols

Re: Migrating Server and Updating Moodle from 2.4 to 3.6+

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers
1. You can have a moodle folder within your public_html folder - you will just need to make sure that your site url points to that folder so that you don't have to type /moodle at the end and change the address in your config.php. If you are using a new url, you will need to run the replace tool (yoursite.com/admin/tool/replace/index.php) to update the database with the new url.

2. You might be able to set the default collation to utf8mb4 somewhere (often depends on how your host sets that up). If not, get it imported as utf-8 and then update. Again, moodle actually has a tool to update your database collation properties so you could use that.

Do NOT use the one click installer ever! These sites always script some extra stuff in there and then we are unable to help because we never know exactly what was done. You are always better off to manually install and manage your moodle installation.
Average of ratings: Useful (1)
In reply to John Nichols

Re: Migrating Server and Updating Moodle from 2.4 to 3.6+

by Ken Task -
Picture of Particularly helpful Moodlers

+20 to what Emma said about those installers.   Besides, since you used git and will continue to use git (I hope) ... that is *the* best way to maintain a moodle's core code and CLI is by far the best way to do site backups.

Migration has always meant xfer of code + moodledata + db to new server environment.

Do get setup with ssh ...

About DB character set/collation ... once you have ssh, look in moodlecode/admin/cli/.   There are scripts in there that help with DB.

Fedora?!   Kinda surprised!! Yes, it's the 'freebie' (development but stable) version of RHEL ... used to run it but (unless things have changed) didn't think Fedora had a 'long term support' distro like RHEL or CentOS (now Stream).

For you, however, the key apps of immediate/near future concern are PHP and MariaDB/MySQL versions and ability to upgrade those.

Just out of curiosity ... think Fedora still uses yum ... try this command when you do get ssh access: yum repolist

RHEL/Fedora has always been conservative when it comes to PHP versions ... but maybe SG has changed that.

'SoS', Ken

In reply to Ken Task

Re: Migrating Server and Updating Moodle from 2.4 to 3.6+

by John Nichols -
Thank you, Emma and Ken. I have SSH'd into SG, here's what I have found out so far:

SG's Moodle app installs version '3.10 (Build: 20201109)', from what I can tell there isn't a choice from their panel. But there is Git functionality.

Server is running Fedora 31 (Thirty One)

They are using MariaDB monitor. Server version: 5.7.26-29-log Source distribution

I selected the PHP version manually in SG's user panel, options are: PHP 8.0.1, PHP 7.4.14, PHP 7.3.26. This is what the server told me about the version:

PHP 7.3.26 (cli) (built: Jan 6 2021 08:23:47) ( ZTS )

yum repolist
repo id repo name
baseos baseos 31 (x86_64)
fedora Fedora 31 - x86_64
fedora-modular Fedora Modular 31 - x86_64
updates Fedora 31 - x86_64 - Updates
updates-modular Fedora Modular 31 - x86_64 - Updates
In reply to John Nichols

Re: Migrating Server and Updating Moodle from 2.4 to 3.6+

by John Nichols -
Hello again everyone,

I got the moodledata, moodle code, and DB files and put into place at the new server. Found out where to put it all and updated the config.php file. I had to get SiteGround to change the DB to MySQL because they do not have the version of MariaDB that Moodle 3.9.3 prefers. I created a new DB after that and imported mine into it. Also, redirected the DNS (but the site name is the same, so didn't need to change anything there).

Only trouble is when I go to our moodle site it looks like it's trying to install. It asks me to confirm their agreements, then takes me to the page that checks that everything is good for the server. Then on the next page, while installing it just hangs during the Install at the System part (similar to this post, but it doesn't do the plugin part like she had happen https://moodle.org/mod/forum/discuss.php?d=329737 )

I've tried replacing all the files again from backups, and resetting up the DB a few times but that didn't seem to help.
In reply to John Nichols

Re: Migrating Server and Updating Moodle from 2.4 to 3.6+

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers

So which version of MySQL is this? Are you getting the copyright page shown here? If so, Moodle can see the database that $CFG->dbname specifies (in config.php) but cannot see the expected Moodle tables. Here's some background on troubleshooting this but basically you need to check the database settings in config.php are correct for the new server, e.g.:

$CFG->dbtype    = 'mysqli';      // 'pgsql', 'mariadb', 'mysqli', 'sqlsrv' or 'oci'

$CFG->dbhost    = 'localhost';  // eg 'localhost' or 'db.isp.com' or IP
$CFG->dbname    = 'moodle';     // database name, eg moodle
$CFG->dbuser    = 'username';   // your database username
$CFG->dbpass    = 'password';   // your database password
$CFG->prefix    = 'mdl_';       // prefix to use for all table names


In reply to Leon Stringer

Re: Migrating Server and Updating Moodle from 2.4 to 3.6+

by John Nichols -
Thank you so much, Leon, your message was what I needed to find the issue. Somehow I had copied the $CFG->prefix from SiteGround's config.php. I had referenced their install of this file to find out the location of where they had put their moodledata. Obviously that prefix didn't match our database tables, making it unable to find what was needed.

We're up and running on the new server now! The owners are checking it out and admin will be soon as well.