{"id":586,"date":"2012-06-29T16:45:05","date_gmt":"2012-06-29T15:45:05","guid":{"rendered":"http:\/\/www.nathankowald.com\/blog\/?p=586"},"modified":"2016-11-13T17:10:31","modified_gmt":"2016-11-13T17:10:31","slug":"upgrading-to-moodle-2-3","status":"publish","type":"post","link":"https:\/\/www.nathankowald.com\/blog\/2012\/06\/upgrading-to-moodle-2-3\/","title":{"rendered":"Upgrading to Moodle 2.3"},"content":{"rendered":"<p>Moodle 2.3 was released on Tuesday (<a href=\"http:\/\/docs.moodle.org\/dev\/Moodle_2.3_release_notes\">release notes<\/a>).<br \/>\nI updated my college&#8217;s Moodle from 2.2.3 to Moodle 2.3 last night. The upgrade took 21 minutes.<br \/>\nI encountered a few problems during the upgrade so thought I&#8217;d post these here.<\/p>\n<p>In <em>making the move to Moodle 2<\/em>, we decided to create a fresh install, then import courses and resources from 1.9 to our fresh 2.2 install.\u00a0Two temporary virtual servers were created for our fresh install.<\/p>\n<h2>Our Server Setup<\/h2>\n<p><strong>Moodle code and MoodleData server<\/strong><\/p>\n<ul>\n<li>Windows Server 2008 Standard (SP1) (64-bit)<\/li>\n<li>(2x) 2.4 GHz Intel Processors<\/li>\n<li>4 GB RAM<\/li>\n<li>IIS7<\/li>\n<li>PHP 5.4 (x86) (Non thread safe,\u00a0PHP via FastCGI)<\/li>\n<\/ul>\n<p><strong>Database server<\/strong><\/p>\n<ul>\n<li>Windows Server 2008 Standard (SP1) (64-bit)<\/li>\n<li>(2x) 2.4 GHz Intel Processors<\/li>\n<li>4 GB RAM<\/li>\n<li>MySQL 5.5.23 (InnoDB table engine used)<\/li>\n<\/ul>\n<h2>Problem 1<\/h2>\n<p><strong>Getting MOODLE_23_STABLE into our forked copy of Moodle<\/strong><br \/>\nHaving forked Moodle in April 2012 our copy did not contain the latest MOODLE_23_STABLE branch so I had to get this branch from upstream.<strong><br \/>\n<\/strong><\/p>\n<p><strong>I used the following Git commands to do grab MOODLE_23_STABLE:<\/strong><\/p>\n<pre class=\"prettyprint lang-sh\">\r\n# get MOODLE_23_STABLE branch and other changes\r\ngit fetch upstream\r\n\r\n# create a new branch that tracks MOODLE_23_STABLE from the official Moodle repository\r\ngit checkout -b MOODLE_23_STABLE upstream\/MOODLE_23_STABLE\r\n\r\n#\u00a0The -u switch sets up tracking to the specified remote: our copy of moodle, 'origin'\r\ngit push -u origin MOODLE_23_STABLE\r\n\r\n# switch to the latest stable branch\r\ngit checkout MOODLE_23_STABLE\r\n\r\n# pull down the latest changes locally\r\ngit pull MOODLE_23_STABLE<\/pre>\n<p>I now had the latest stable version of Moodle on our server so could continue with the upgrade.<\/p>\n<h2>Following Instructions<\/h2>\n<p>I followed the guide to upgrading to Moodle 2.3:\u00a0<a href=\"http:\/\/docs.moodle.org\/23\/en\/Upgrading_to_Moodle_2.3\">http:\/\/docs.moodle.org\/23\/en\/Upgrading_to_Moodle_2.3<\/a><\/p>\n<p><strong>System Requirements<\/strong><br \/>\nI checked the system requirements for Moodle 2.3 and saw that we met them.<\/p>\n<p><strong>Maintenance Mode<br \/>\n<\/strong>I put our Moodle 2.23 into maintenance mode so only the administrator could work on the site.<br \/>\nI then went into IIS7 Server Manager and stopped the server. I wanted to make sure no changes would be made to the Moodle database or MoodleData.<\/p>\n<p><strong>Disabled The Cron Scheduled Task<\/strong><\/p>\n<p><strong>Backup!<\/strong><br \/>\nI backed up our:<\/p>\n<ul>\n<li>Database<\/li>\n<li>MoodleData folder (98 GB)<\/li>\n<li>Moodle files (2.23)\u00a0(checked out conel-MOODLE_22_STABLE using Git and copied the contents)<\/li>\n<\/ul>\n<p>I used MySQL Workbench to backup our Moodle database. I used the &#8216;Export to Dump Project Folder&#8217; option. This saves each table into a separate file, allowing a selective restore. You can still import all tables at the same time by selecting the folder these are stored in.<br \/>\nI copied MoodleData and the core moodle files using Windows Explorer, renaming them <strong>moodle22_backup<\/strong>, <strong>moodle22_DBbackup<\/strong>, <strong>moodle22_MoodleData<\/strong>.<\/p>\n<p>It took 1.5 hours to copy our 98 GB of MoodleData.<\/p>\n<p>While it was copying I read the Moodle installation problems forum to get an idea of common upgrade problems I might face.\u00a0<a href=\"http:\/\/moodle.org\/mod\/forum\/view.php?id=28\">http:\/\/moodle.org\/mod\/forum\/view.php?id=28<\/a><\/p>\n<p>When MoodleData had finished copying and I was confident I could restore to 2.2 if anything went wrong with the upgrade, I started the server and browsed to the admin page.<\/p>\n<p>It detected the new Moodle 2.3 version and went through the requirements check &#8211; OK.<br \/>\nThe next page listed the updates that were to be made. There was a useful button which checked for any updates to blocks and modules. It&#8217;s recommended that before upgrading, you have the latest versions of blocks and modules. I updated one block that had updates and pressed next to start the upgrade.<\/p>\n<p><strong>Time Your Upgrade<\/strong><br \/>\nIt&#8217;s a good idea to time your upgrade. I started my timer. After five minutes I experienced a server timeout error.<\/p>\n<h2><strong> Problem 2<\/strong><\/h2>\n<p><strong> Server timeouts<br \/>\n<\/strong>My first and second attempt to upgrade Moodle failed after 5 minutes. This suggested to me that I needed to increase timeout\u00a0settings\u00a0on our server.<br \/>\nI updated PHP&#8217;s maximum execution time to be 3600 seconds (1 hour). Not knowing how long upgrades took, I thought this would be fine. I restarted the server.<\/p>\n<p>Not knowing if the Moodle upgrade would continue where it left off, I refreshed Moodle and saw a message saying, <strong>&#8220;Site is being upgraded, please retry later&#8221;<\/strong>.<br \/>\nKnowing I&#8217;d restarted the server already so killed any PHP processes running during the upgrade I restored the database to its previous 2.23 state.\u00a0I then retried the upgrade.<\/p>\n<p>My second attempt at upgrading failed with the same <strong>500 Internal Server Error<\/strong> message. I realised then that I had not changed FastCGI&#8217;s timeout settings.<br \/>\nIn FastCGI settings I changed:<strong> Activity Timeout<\/strong>, <strong>Idle Timout<\/strong> and <strong>Request Timeout<\/strong> to 3600 seconds (1 hour).\u00a0I restored the database to its previous 2.23 state again. I didn&#8217;t restore MoodleData. I restarted the server.<\/p>\n<p><strong>My third attempt was successful!<\/strong><br \/>\nIt took 21 minutes to upgrade.<\/p>\n<p>Moodle then displayed lots of updated plugin settings. I left most as their defaults and continued.\u00a0I then took Moodle out of maintenance mode and had a quick play with the new file enhancements. They&#8217;re great!<\/p>\n<p>A big thanks to all <a href=\"http:\/\/moodle.org\/dev\/contributions.php?version=2.3.x\">the developers who contributed<\/a>\u00a0to this fine release!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Moodle 2.3 was released on Tuesday (release notes). I updated my college&#8217;s Moodle from 2.2.3 to Moodle 2.3 last night. The upgrade took 21 minutes. I encountered a few problems during the upgrade so thought I&#8217;d post these here. In making the move to Moodle 2, we decided to create a fresh install, then import [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[13,15,7],"tags":[],"class_list":["post-586","post","type-post","status-publish","format-standard","hentry","category-git","category-moodle","category-web-development"],"acf":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.nathankowald.com\/blog\/wp-json\/wp\/v2\/posts\/586","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.nathankowald.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.nathankowald.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.nathankowald.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.nathankowald.com\/blog\/wp-json\/wp\/v2\/comments?post=586"}],"version-history":[{"count":108,"href":"https:\/\/www.nathankowald.com\/blog\/wp-json\/wp\/v2\/posts\/586\/revisions"}],"predecessor-version":[{"id":1774,"href":"https:\/\/www.nathankowald.com\/blog\/wp-json\/wp\/v2\/posts\/586\/revisions\/1774"}],"wp:attachment":[{"href":"https:\/\/www.nathankowald.com\/blog\/wp-json\/wp\/v2\/media?parent=586"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.nathankowald.com\/blog\/wp-json\/wp\/v2\/categories?post=586"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.nathankowald.com\/blog\/wp-json\/wp\/v2\/tags?post=586"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}