How to upgrade Moodle CMS to 3.5 version via command line.
Step 1: Login to your Moodle admin panel
Step 2: Check your server requirements for 3.5 version via Administration > Site administration > Server > Environment
Step 3: The minimum PHP 7 version is for required for Moodle 3.5 version and also we need to enable the PHP extensions ‘intl’
Step 4: Enable the upgrade key before starting the upgrade process, to enable this paste the below code in config.php file under Moodle directory.
+++
$CFG->upgradekey = ‘put_some_shared_secret_here’;
+++
Step 5: Before proceeding upgrade, we recommend you to take backup of moodledata, moodle folders and database of your Moodle software.
Step 6: Update all the plugins to the latest version to avoid any Moodle version upgrade issues. Kindly note that, out-of-date plugin causes your upgrade to fail. To upgrade plugins automatically via Moodle admin panel go to Site administration >> Plugins >> Plugins overview >> Check for available updates. If there is any available plugin updates then, click on ‘Install available updates’ to upgrade all plugins.
Step 7: Enable ‘Maintenance mode’ via Administration > Site administration > Server > Maintenance mode or just enable by pasting the
below code on the moodle/config.php file.
+++
$CFG->maintenance_enabled=0
+++
Step 8: Download the latest version of Moodle 3.5 software zip file from the below URL and upload on the document root directory of
your Moodle installation via cPanel >> File manager. Once you are done rename the existing moodle file into ‘moodle-bakup’ and extract
the zip file.
+++
wget http://sourceforge.net/projects/moodle/files/Moodle/stable35/moodle-latest-35.tgz
+++
If you have command line or SSH access for your server, run the below commands.
+++
mv moodle moodle.backup
tar xvzf moodle-3.5.tgz
+++
Step 9: Next, copy across your config.php, any custom plugins, and your .htaccess file if you created one.
+++
cp moodle.backup/config.php moodle
cp -pr moodle.backup/theme/mytheme moodle/theme/mytheme
cp -pr moodle.backup/mod/mymod moodle/mod/mymod
+++
Step 10: Once you are done, visit the Moodle admin URL and complete the up-gradation process. If any error message displays during the up-gradation, kindly troubleshoot it accordingly to continue the up-gradation.