Migrating old instance (ver 2.5) to new webserver

Migrating old instance (ver 2.5) to new webserver

by Tim Bunch -
Number of replies: 9

I found myself having to support a moodle 2.5 instance, and would like to migrate it to a new webserver with a supported OS.  The group that supports the courses is planning on moving to another platform at some point so there's no effort to upgrade the version of Moodle.

My question is, if I move the moodle installation to the new server, will I be able to test it while the production install is still running?  They would both be pointing to the same database and we'd like to just make sure the site comes up properly and logins work, but I don't want to introduce any problems into the database.  The DB is on a separate server so that won't be moving, and I'll be using the same version of php.  Does anyone know of the "proper" way to test a migrated install?

Edited to include other version info:

PHP version 5.3

OS: Old server is Windows 2008R2, new is Windows 2019

Average of ratings: -
In reply to Tim Bunch

Re: Migrating old instance (ver 2.5) to new webserver

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Non-Windows person here. Therefore only very generic answers possible.

Q1. Moving a Moodle rel. 2.5 to another, newer server
Here are the minimum software requirements: https://docs.moodle.org/dev/Moodle_2.5_release_notes#Requirements.

Warning: There are also maximum software requirements, which were unknown when 2.5 released, May 2013, BTW. This table, http://www.syndrega.ch/blog/#php-and-dbms-compatibility-of-major-moodle-releases will give you a rough idea. (It has no rel. 2.5 information, but 2.4 and 2.7 LTS.)

I would do a test upgrade to 2.7 in the new server: https://docs.moodle.org/27/en/Upgrading. 'course it is up to you.

Q2. Two Moodle instances pointing to the same database
No. They'll eat each other!
smile
In reply to Visvanath Ratnaweera

Re: Migrating old instance (ver 2.5) to new webserver

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Correction to Q2. You could make two Moodle instances to use the same database, by assigning them different table prefixes. You need to be very careful though, usually not worth the trouble.
In reply to Visvanath Ratnaweera

Re: Migrating old instance (ver 2.5) to new webserver

by Tim Bunch -
So there's no way to migrate Moodle to another webserver and test it before making the change permanent?
In reply to Tim Bunch

Re: Migrating old instance (ver 2.5) to new webserver

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
What are you talking about? Where did I say that?

Read carefully what I said, specifically,

I would do a test upgrade to 2.7 in the new server: https://docs.moodle.org/27/en/Upgrading.
In reply to Visvanath Ratnaweera

Re: Migrating old instance (ver 2.5) to new webserver

by Tim Bunch -
I was responding to this, not the upgrade recommendation:
Q2. Two Moodle instances pointing to the same database
No. They'll eat each other!

I was hoping to be able to put the original site in maintenance mode (or just disable the web server temporarily), copy the files to the new webserver, and test navigating the site.  That way if we had issues we could just turn the original instance back on.  My goal is just to get it running on a newer OS with as few changes as possible as I'm trying to get rid of older OS versions.

We don't have anyone Moodle-savvy here as this was set up years ago by an acquired company, so I'm trying to avoid any changes if possible.  

Thanks for taking the time to answer my questions - all the docs I've found deal mostly with either installs or upgrades.  The few documents around migrations I've found assume that you are moving the database as well, which I won't need to do.  I wonder if making a copy of the database at the same time and running the new server off of that would be an answer.  I'll have to update the database in the config.php, not sure if that's the only place though.

In reply to Tim Bunch

Re: Migrating old instance (ver 2.5) to new webserver

by Ken Task -
Picture of Particularly helpful Moodlers

On DB server clone the moodle DB to another name - like moodle2.

On new Web server, change config to point to the moodle2 DB.

But, putting site in maintaince mode just denies access to student/teacher users.   The server still has the same fully qualified domain name and certificate for https.   This new web server can't have the SAME FQDN can it?

Well, there is a way ... on the work station you are using to check new server out, map the FQDN to the new server's IP address (host file).  That will work only if one can set dns to check files first (host file) then a DNS server.

If the new server has a slightly different FQDN ... like moodle2.whatever ... the clone of the DB will have to have all internal links converted to new FQDN as well as a change to config.php.  Otherwise you end up with the clone talking to the true production site and that's what you don't want!

'SoS', Ken

In reply to Tim Bunch

Re: Migrating old instance (ver 2.5) to new webserver

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Oh, yes, migration. There is a separate documentation, https://docs.moodle.org/25/en/Moodle_migration.

Upgrading and migration are two different things. One could combine them but generally not advised. If the double step fails, you don't know which one.
In reply to Visvanath Ratnaweera

Re: Migrating old instance (ver 2.5) to new webserver

by Tim Bunch -
I'm going to have the DBA copy the DB and create a new user that I'll use in the new webserver's copy of the code. That way I know it won't be hitting prod. Thanks for the assist!
In reply to Tim Bunch

Re: Migrating old instance (ver 2.5) to new webserver

by Ken Task -
Picture of Particularly helpful Moodlers

Strongly suggest logging into current server then go to Admin -> Server -> Environment check.  Update component.

Then choose each higher version of Moodle in the drop down to see what over update/upgrade you will need to perform *before* trying to upgrade.

From 2.5.x to 3.11.highest (4.0 to be released this month) there will be php version upgrades, + new PHP extensions (like sodium), DB server upgrades, + updates to plugins and themes in moodle.

Basically, one cannot hyperjump from 2.5.x to whatever version is destination.   This will be a march of moodle upwards.

All of that is best tested on a clone of the current/in use site.   There will be bumps in the road that you'll have to sort out.

At each stage of the march, make a site backup ... code + DB ... so, if on the next hop upwards, something fails, you haven't lost but one hop.

'SoS', Ken