Moodle Upgrade 4.0.1 to 4.2.3
From Notes_Wiki
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-user> -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