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

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

by Cindy Weber -
Number of replies: 9

I am struggling with the need to upgrade 3 moodle sites.  They are all 2.4 versions.  My main add-on module is certificate.  I think I need to upgrade because my adult students use a variety of platforms (iphones, ipads, computers, etc.) to view the courses, and they can't see some of the activities on some of the devices.  I also see an advantage of using the new quiz features in 3.0.

I have hundreds of students in the moodles, accessible to them 24/7.  Most of my students have enrolled through external database.

I know I must have upgraded years ago, but I haven't upgraded since.  After I had quite a few modifications, I stopped upgrading.  A couple of weeks ago, I asked my host to provide me with a clone of one of my moodle sites, so I wouldn't have to practice on my production site, and the host copied over one of my moodle sites, and crashed it.  24 hours later, it was finally working again, but it had doubled in size.  That added to my worries.  

The one thing that my host does well is install new moodle sites.  I had them install a new one on the site, and it works fine.  I added certificate.  

I have looked at GIT, and most of the documentation seems to be written towards a new install and not an upgrade.  I was once a MS-DOS user, so I am willing to tackle GIT, but I wish there was clearer instructions for a moodle upgrade.  I have read Git_for_Administrators, watched youtubes, read the forum posts, and unfortunately have gained little confidence that I am prepared.  

Am I making this harder that it is?  Or do I not understand how much I really don't understand?  smile  

Is it possible to use my new moodle, and somehow just  "copy my old config.php file back into the new moodle directory"?  I read that I cannot copy over the old files with the new files.  Would that move students and courses into a new moodle?  Would something like that work?  

I also thought about creating a new moodle for new students but I think that would create confusion for the students.  

Any suggestions?  I don't want to crash my existing moodles when students are working in them.                                      

Average of ratings: -
In reply to Cindy Weber

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

I'll start with a few simple questions for you.  What version of moodle are you using and what version do you want to upgrade to?  Do you know if your hosting company meets the minimum requirements of your desired moodle, such as Moodle 3.0.3+? 

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

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

by Cindy Weber -

I am using 2.4.3.  Since I haven't upgraded in a while, I thought I would upgrade to the most current version, 3.0.  Siteground is my host and they installed a moodle of that new version on my site.  It seems to work fine.  

In reply to Cindy Weber

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

What version did Siteground install for you?

Here's a thought:  Have Siteground install 2.4.3 for you, a fresh copy.  Then (either you or Siteground), have them import your current mySQL data into it, and copy over your moodledata folder contents to it, and then copy config.php.  Essentially, you will be trying to "duplicate" your current moodle.  You will need to edit config.php reflecting the new installation.  Then, follow the recommended methods to upgrade this moodle, step-by-step (I don't know the exact progression, but you might be able to jump right from 2.4.3 to 3.0.3+) procedures.

If successfully, you will then have an "experimental" copy of moodle.  This method provides you some moodle administrative education,  and you will have a copy of moodle for you to explore all of the new improvements.

Do you know if you have a lot of add-ins and modifications of your current moodle?  If so, your challenge will be greater.

In reply to Cindy Weber

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

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

Actually I would copy your existing moodledata folder and make a copy of your database and then point the 3.0.3 to your new moodledata folder and new database.  You could do that by deleting the config.php file in the 3.0.3 install and then when it thinks it is a new install, just point it to your newly created folder and database.  It should then go through the upgrade process and you will have a test installation with the new code.

Average of ratings: Useful (1)
In reply to Cindy Weber

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

by Visvanath Ratnaweera -
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.