by Ken Task.
Welcome. So I take it that you now have a functioning 2.6.11+ site running, right?
Now the next step ... the hard way is the old way ftp files, copy plugins config.php etc. etc. ... leaves to much room for human error.
The *BEST* way is to use git. Assumes CentOS
skip this part ... go to **HERE** below cause you already have git.
Install git:
yum -y install git
Once it's installed ... whereis git ... will show the path to git ... probably in /usr/bin/git Perfect!
Now the tricky part ... can't update/upgrade a moodle code directory without the hidden .git diretory in the code directory.
So we side load a moodle 2.6.11+ directory using git, then copy the hidden .git directory from the sideload to the active code directory.
Let's say the code is in /var/www/html/
As root user, in /var/www/
issue the following command:
git clone git://git.moodle.org/moodle.git htmlgit
That will create a directory called htmlgit ... it's the one that will have the hidden .git directory in it.
Next cd htmlgit ... issue the following commands in the order shown:
git branch --track MOODLE_26_STABLE origin/MOODLE_26_STABLE
git checkout MOODLE_26_STABLE
to see what git has set:
fgrep '$release' version.php
should show you 2.6.11+
Great ... now the copy
You are still in /var/www/htmlgit
cp -rp .git ../html/.git
that's copy, recursively preserving permissions .git to ../html/.git which is up on level from htmlgit
When it's finished .... cd ../html/
Now check to see git works.
git pull [ENTER].
It shouldn't pull anything of core code ... it's already there and the highest version of that series.
** AFTER ** you have checked out the site ... everything works, ** MAKE A FULL SITE BACKUP **
** HERE **
mkdir /home/backup ... reason for creating location ... home is probably largest partition
from /var/www/ which should be the location of moodledata, issue the following commands
tar -cvf /home/backup/moodledata2611+.tar ./moodledata
tar -cvf /home/backup/moodlecode2611+.tar ./html/ that should get the code.
mysqldump -u [UPSERUSER] -p[password] [MDLDBNAME] > /home/backup/moodledb2611+.sql
Now to upgrade to 2.7 ... the easy way.
Back to using git.
git branch --track MOODLE_27_STABLE origin/MOODLE_27_STABLE
git checkout MOODLE_27_STABLE
git pull
(git will acquire 27 code and replace/add/delete whatever it needs ... but only core ... will NOT touch the addons/plugins)
php admin/cli/upgrade.php --non-interactive
The DB will be updated ... script uses the DB information in config.php of the site.
When that finishes:
fgrep '$release' version.php to see if it now says it's 2.7.highest.
** important **
You've been doing this as root ... all files/diretories that were changed below to root user and root group. Need to change them all for apache user and apache group. ... Uhhhh ... will harden later ... after the march.
while in /var/www/html/
chown apache:apache * -R
Check config.php ...
ls -l config.php ... that file needs to have at least read access by all - that's the last 'r' in the output of the ls -l config.php command.
Now hit site with browser.
Check things out ... get plugin updates.
Everything OK?
**BACKUP** changing the backup file names so they contain 27 version number.
Then we repeat the process ... changing only the numbers for the version we desire.
27 to 28
Here's one bash shell script you could use to either update or upgrade ... depending upon what's commented out. ** EDIT FOR YOUR SYSTEM ** If you don't have shell access .. get it.
put into /var/www/html/ to make the march easier
# 2.7.18 (Build: 20170109)
tar -cvf /home/backup/moodles/moodle2718-code-$(date +%Y%m%d%-H%M%S).tar ../moodle27;
tar -cvf /home/backup/moodles/moodle-data-2718-$(date +%Y%m%d%-H%M%S).tar /var/www/moodle27data;
mysqldump -u root -p[PASSWORD] moodle27 > /home/backup/moodles/moodle2718-db-$(date +%Y%m%d%-H%M%S).sql;
git branch -a
php admin/cli/cron.php;
php admin/cli/maintenance.php --enable;
git pull;
php admin/cli/upgrade.php --non-interactive;
# git branch --track MOODLE_28_STABLE origin/MOODLE_28_STABLE;
# git checkout MOODLE_28_STABLE;
# php admin/cli/upgrade.php non-interactive;
# php admin/cli/cron.php;
php admin/cli/maintenance.php --disable;
chown apache:apache * -R
fgrep '$release' version.php
Can 'march' a moodle up through each version 2.7->2.8->2.9->3.0->3.1->3.2 in one day's time
That includes backups and checking and acquiring updates to plugins via mdeploy via the Moodle UI as admin level user ... but not any config of additional features added in 3.1> of core.
'spirit of sharing', Ken