New Moodle admin needs help upgrading to 2.6.1

New Moodle admin needs help upgrading to 2.6.1

by Tom Hesser -
Number of replies: 2

Hi,

I recently inherited the admin duties for a currently in-use Moodle installation and I haven't had any previous experience with it. My first task was to upgrade from;

  • Moodle 2.5.4+ (Build: 20140228) Version 2013051404.1 (Stable version)

to

  • Moodle 2.6.1+ (Build: 20140228) Version 2013111801.1 (Stable version)

I attempted to follow the upgrade documentation, but I kept running into discrepancies with our installation. Right off the bat, I ran into a problem with the backup instructions;

  1. Moodle software (For example, everything in server/htdocs/moodle)
  2. Moodle uploaded files (For example, server/moodledata)

I have no "moodle" dir within "htdocs" and no "moodledata" dir anywhere. This is the list of items I have at the / level of the server;

00_private
backups
cgi-bin
errors
htdocs
logs
phptmp

As far as I can tell, the install is bare-bones with around 50 short courses set up. Since my installation seems to differ from the instructions and other doc references, I don't want to do anything until I know exactly what is going on and that I won't loose any course or user data. I feel like I am missing some important piece of the puzzle. If someone more savvy could lend me a hand getting the right "picture" of what is going on, I think I should be able to take it from there.

 

Thank you

Average of ratings: -
In reply to Tom Hesser

Re: New Moodle admin needs help upgrading to 2.6.1

by Ken Task -
Picture of Particularly helpful Moodlers

A little more information could have been used to make this response more accurate, but from what information shared ...

htdocs is your web server document root.   Moodle code is probably located there.   Inside htdocs one should find a config.php file.  You can 'discover' the location of the data directory by inspecting that file - as well as the DB user, the DB, and the DB password to use with mysqldump.

As far as upgrading, **first make a complete site backup** ... tar ball of code directory, tar ball of data directory, and an sql dump of the DB.  It is usually recommended to beginning admins to work though the upgrade in a test environment .... same OS, same PHP, same mysql, same web server software, etc..  Much can be learned and it's much safer ... ie, won't trash production server/environment.

Depending upon OS/remotely hosted dedicated or shared/ command line access? ... think upgrading via git the route to go.  The directions at http://docs.moodle.org/26/en/Git_for_Administrators would have to be adjusted if doing this on the production server.

One could (on Linux with command line access and git installed), acquire the 2.6.x code via git into an htdocsgit directory.   Copy the config.php file from htdocs to htdocsgit.   Copy any directory in htdocs/mod/, htdocs/blocks/, htdocs/themes/ that are NOT in htdocsgit (those are add-ons).  Note the ownerships/permissions on htdocs and make htdocsgit directory and all files/folders contained therein the same.

Then:

mv htdocs htdocs-old (this keeps the old code directory in case one has to 'roll back')

mv htdocsgit htdocs

cd htdocs/admin/cli/

php upgrade.php

The upgrade process *will* make changes to the DB - that's why you made an sql dump of what you had at 2.5.x.

If all goes well and the upgrade.php script finishes one should be able to access the site with browser, login, and check version by going to Site Admin menu, Notifications.  If the upgrade complains about things missing, might have to inspect directories of htdocs-old and move some more to htdocs/same location.   You could have other non-core add-ons that weren't a mod/block/ or theme.

Spot check things ...

At this point, I'd recommend making another full site backup ... new code directory, even if the data directory did not change, the data directory, and especially, an sql dump of the DB.

Others might have a different method, but the one above has worked for me.

'spirit of sharing', Ken

 

Average of ratings: Useful (1)
In reply to Tom Hesser

Re: New Moodle admin needs help upgrading to 2.6.1

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Note that moodle and moodledata are just conventional names. To find out what they are really called, you need to find the config.php files, which is in the moodle folder. Argh! infinite recursion error!

OK, well you can work out what the Moodle folder is called from the URL used to access the site. If that URL is like http://mydomain.com/ then it is likely that the 'moodle' fodler is htdocs.

If the URL to access Moodle is like http://mydomain.com/some/path/ then the folder will be htdocs/some/path, etc.

Once you have found config.php, then look inside. That will tell you which database your Moodle site is using, and which 'moodledata' folder. That is given by $CFG->moodledata.

I hope that makes sense.