Can I create a new moodle, replace my new config.php file, and call it an upgrade?

Re: Can I create a new moodle, replace my new config.php file, and call it an upgrade?

by Visvanath Ratnaweera -
Number of replies: 4
Picture of Particularly helpful Moodlers Picture of Translators
No!

The Moodle upgrade is well documented: https://docs.moodle.org/en/Upgrading.

Yes, a broken upgrade can not be undone. Take a https://docs.moodle.org/24/en/Site_backup first. And make sure you can https://docs.moodle.org/24/en/Site_restore.
In reply to Visvanath Ratnaweera

Re: Can I create a new moodle, replace my new config.php file, and call it an upgrade?

by Dave Stedman -

I disagree about it being "well" documented. Its certainly documented for someone who has been working with it for some time. My problem is i inherited this mess from someone else. My install doesn't even have a moodledata folder, which is apparently important, and since there is no mention whatsoever in the docs about what contents i should expect to see in this folder it is impossible for me to know which folder i need to backup. And this is just one example. 

To be honest, what the poster is describing is exactly my understanding of how the upgrade works.

Rename your current moodle folder

Extract new moodle file into a directory that matches the old one.

copy back moodledata folder, and config file.

Hit the site with a browser.

There is also plenty of mentions about GIT, but why would i need a program to do the steps above?

In reply to Dave Stedman

Re: Can I create a new moodle, replace my new config.php file, and call it an upgrade?

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers

Dave,

Your install certainly does have a moodledata folder - although the person who originally set up the 'mess' as you call it may have named it something else - and your config.php will tell you exactly where it is. Its not only 'important', its essential, Moodle will not function without it.

Look in your site config.php for the line that says

$CFG->dataroot  = '/path/to /your/moodledata';

That is usually outside your moodle code root, so there should normally be no need to 'copy back the moodledata folder' just the config.php. Of course if a shared hosting solution has forced the moodledata into the core moodle folder and protected it via htaccess that may be different, but that would not be a standard setup.


You don't need GIT to do the steps you outlined, but it can be a very useful tool for managing code especially for applying patches and fixes without requiring a full upgrade.

HTH

Richard

In reply to Richard Oelmann

Re: Can I create a new moodle, replace my new config.php file, and call it an upgrade?

by Dave Stedman -

Richard,

Thanks for the help. That little bit of information is exactly the kind of thing i am referring to as missing from the docs. At your advice, I was able to find where the folder is, although there is a child moodledata folder at this location which is empty. I guess i have to assume this was a config error at the initial install.


Thanks for the help!

In reply to Dave Stedman

Re: Can I create a new moodle, replace my new config.php file, and call it an upgrade?

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers

You almost have all the steps:

Step 1: Backup your current moodledata and database (mySQL typically, but I am not sure what you might have.)

Step 2: Figure out if you have any special add-ins that "someone" might have installed.  (Goto Site Administration, Plugins, and look for "Additional".

Step 3: Figure out what theme you have.  If the someone added a special theme, this could present problems when you upgrade.

Step 4: Rename..., yes, do this.

Step 5: Extract..., yes, do this.

Step 6: Copy your old config.php file to your new moodle.

Step 7: Reinstall any plugins that were in your old moodle to your new moodle.

Step X: No need to do anything with you old moodledata folder.

Step 8: Hit the site..., yes, do this.

My guess is that add-ins might give you the most trouble.

Others here on moodle.org might want to provide some additional things to do in my list.