Difference between revisions of "Moodle Upgrade 4.0.1 to 4.2.3"

From Notes_Wiki
Line 5: Line 5:


<pre>
<pre>
mysqldump -u moodledude -p moodle > moodle_db_backup.sql
mysqldump -u <DB-name> -p <DB-name> > moodle_db_backup.sql
</pre>
</pre>



Revision as of 06:18, 16 October 2025

Home > Ubuntu > Ubuntu 22.04 > Ubuntu 22.04 Moodle Upgrade > Moodle Upgrade 4.0.1 to 4.2.3


  • take the DB dump
mysqldump -u <DB-name> -p <DB-name> > moodle_db_backup.sql
  • backup moodle directories
sudo tar czf moodledata_backup.tar.gz /var/moodledata
sudo tar czf moodle_code_backup.tar.gz /var/www/html/moodle
  • go to moodle directory
cd /var/www/html
  • rename the old moodle folder
sudo mv moodle moodle_old
  • Download moodle package from the official website and extract the package
  
sudo tar -zxvf moodle-4.2.11.tgz 
  • Copy the configuration file from the old moodle
sudo cp moodle_old/config.php moodle/
  • Give required permissions and ownership
sudo chown -R www-data:www-data moodle
    
sudo chmod -R 755 moodle
sudo chown -R www-data:www-data /var/moodledata
  • Edit the php.in file, uncomment and change the value to 5000
vim /etc/php/8.1/apache2/php.ini

	max_input_vars = 5000
  • Open moodle on a browser and follow the steps to upgrade Moodle
  • remove the old moodle folder
sudo rm -rf /var/www/html/moodle_old