Moving from Mac OS X to Linux Virtual and Upgrading

Moving from Mac OS X to Linux Virtual and Upgrading

by Peter Mills -
Number of replies: 6

Hello,

We currently have Moodle version 2.3.3+ (Build: 20121208) running on a Mac OS X 10.6.8 server. We would like to move Moodle from this old server to a new Virtual Linux server

Can someone please give me some directions on how to best achieve this?

Would it be best trying to upgrade Moodle on the current server and then move it to a new server?

Thank you to anyone who can help.

Peter



Average of ratings: -
In reply to Peter Mills

Re: Moving from Mac OS X to Linux Virtual and Upgrading

by Ken Task -
Picture of Particularly helpful Moodlers

Official docs here: https://docs.moodle.org/29/en/Moodle_migration (says 29 but it's the same as 2.3.x really)

Un-official (but have plenty of experience) follows ... but first ... some questions for ya ...

Linux system is virtual but what virtual operating system is it?  Ubuntu/CentOS/???   Makes a diff concerning locations.  Is it a dedicated Linux server or a shared virtual hosting package?

uname -an

Does Linux server have git, mysqld, httpd, php installed?   Versions are? (see below)

php -v, git -version, mysql -V, /usr/sbin/apachectl -version

In other words, does the linux box have the pieces already installed with everything needed for hosting a Moodle?  And does the Linux box have enough 'umph' (specs) to run a 2?  Memory, HD space, number cores, etc..

What's the current FQDN of the Mac Moodle server?   Will the hostname (FQDN) be same on Linux server?  Moodle records the FQDN for every internal link in the DB.

On the mac server Moodle: got any addons/plugins?

On the mac server: got mysqldump?  whereis mysqldump or sudo find / -name mysqldump

On the mac server: got 'git'?  whereis git or sudo find / -name git

One could upgrade on the mac, tarball/sqldump what's needed, scp the backups to the linux box, extract the tarballs into proper locations for the OS, import the sql dump into a moodle DB, change config.php  file of moodle code to reflect new host, DB info, etc.  Set ownership/permissions appropriate to new server OS, and then ... you should be set once you run search and replace for a change of FQDN.

OR, one could 'git' the moodle code into www docroot on linux server for version 2.3.highest, scp config.php from Mac to www docroot of Linux server and edit it to reflect new server URL, DB user, pass etc.  scp the mac server moodledata directory to a moodledata directory on Linux server (reset ownerships/permissoins).  scp the .sql dump from the Mac server to the linux server and import the DB to the Linux MySQL server (same search and replace for FQDN).

This is a general description ... specifics when info is known. ;)

'spirit of sharing', Ken

In reply to Ken Task

Re: Moving from Mac OS X to Linux Virtual and Upgrading

by Peter Mills -

Hi Ken,

Thank you for replying. I'll try and answer your questions below:

Linux system is virtual but what virtual operating system is it?  Ubuntu/CentOS/???   Makes a diff concerning locations.  Is it a dedicated Linux server or a shared virtual hosting package?

>> The virtual Linux server will be running on Windows Hyper-V. I haven't created it yet but it would probably be running Ubuntu.

Does Linux server have git, mysqld, httpd, php installed?   Versions are? (see below)

>> Not sure yet.

In other words, does the linux box have the pieces already installed with everything needed for hosting a Moodle?  And does the Linux box have enough 'umph' (specs) to run a 2?  Memory, HD space, number cores, etc.. 

>> Nothing is installed yet but the hardware resources will be there as it is a new server with plenty of memory, hard drive space and cores.

What's the current FQDN of the Mac Moodle server?   Will the hostname (FQDN) be same on Linux server?  Moodle records the FQDN for every internal link in the DB.

>> The FQDN will be the same.

On the mac server Moodle: got any addons/plugins?

>> I believe so.

On the mac server: got mysqldump?  whereis mysqldump or sudo find / -name mysqldump

>> Will need to check this after the Carbon Copy Clone of the mac server has finished

On the mac server: got 'git'?  whereis git or sudo find / -name git

>> Again I will need to check this after the Carbon Copy Clone.

Thank you again for your assistance.

Peter

In reply to Peter Mills

Re: Moving from Mac OS X to Linux Virtual and Upgrading

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

I suggest starting with the Linux Installation docs.  There are some good step by step documents there that will get your server ready for moodle, making sure that you get all the correct php modules installed etc.

Once you have php and apache  and mysql all up and running, then switch to the migration documents and go through those. 

It not a hard process - I use Linux debian on hyper-v and several times have just fired up a new server and migrated moodle over when I am upgrading. That is sometimes quicker than running a full backup.  Once the new instance is good to go, I can just switch the ip address on the machine, make sure config.php is all correct and take the original offline.

In reply to Emma Richardson

Re: Moving from Mac OS X to Linux Virtual and Upgrading

by Peter Mills -

Hello all,

Thank you all for you replies and sorry for not getting back to you sooner.

I have completed creating the new linux virtual server and set it up with apache2, php and mariadb instead of mysql.

I have moved the MoodleWWW folder and the MoodleData folder and updated the config.php file. I have also restored the sql database.

I have created DNS entries for the new site and can access it ok.

The moved site displays the home page however when I login to the admin account I get the following errors:

----------

Strict Standards: Declaration of ilp_dashboard_template::install_new_plugins() should be compatible with ilp_plugin::install_new_plugins($dbplugins, $plugin_class_directory) in /var/www/html/MoodleWWW/blocks/ilp/classes/plugins/ilp_dashboard_template.class.php on line 20


Strict Standards: Non-static method ilp_dashboard_template::install_new_plugins() should not be called statically in /var/www/html/MoodleWWW/blocks/ilp/settings.php on line 30


Strict Standards: Non-static method ilp_plugin::install_new_plugins() should not be called statically in /var/www/html/MoodleWWW/blocks/ilp/classes/plugins/ilp_dashboard_template.class.php on line 64


Strict Standards: Declaration of ilp_dashboard_plugin::install_new_plugins() should be compatible with ilp_plugin::install_new_plugins($dbplugins, $plugin_class_directory) in /var/www/html/MoodleWWW/blocks/ilp/classes/plugins/ilp_dashboard_plugin.class.php on line 0


Strict Standards: Non-static method ilp_dashboard_plugin::install_new_plugins() should not be called statically in /var/www/html/MoodleWWW/blocks/ilp/settings.php on line 34


Strict Standards: Non-static method ilp_plugin::install_new_plugins() should not be called statically in /var/www/html/MoodleWWW/blocks/ilp/classes/plugins/ilp_dashboard_plugin.class.php on line 51


Strict Standards: Declaration of ilp_dashboard_tab::install_new_plugins() should be compatible with ilp_plugin::install_new_plugins($dbplugins, $plugin_class_directory) in /var/www/html/MoodleWWW/blocks/ilp/classes/plugins/ilp_dashboard_tab.class.php on line 0


Strict Standards: Non-static method ilp_dashboard_tab::install_new_plugins() should not be called statically in /var/www/html/MoodleWWW/blocks/ilp/settings.php on line 38


Strict Standards: Non-static method ilp_plugin::install_new_plugins() should not be called statically in /var/www/html/MoodleWWW/blocks/ilp/classes/plugins/ilp_dashboard_tab.class.php on line 72


Strict Standards: Declaration of ilp_mis_plugin::install_new_plugins() should be compatible with ilp_plugin::install_new_plugins($dbplugins, $plugin_class_directory) in /var/www/html/MoodleWWW/blocks/ilp/classes/plugins/ilp_mis_plugin.class.php on line 0


Strict Standards: Non-static method ilp_mis_plugin::install_new_plugins() should not be called statically in /var/www/html/MoodleWWW/blocks/ilp/settings.php on line 42


Strict Standards: Non-static method ilp_plugin::install_new_plugins() should not be called statically in /var/www/html/MoodleWWW/blocks/ilp/classes/plugins/ilp_mis_plugin.class.php on line 103


Fatal error: Call-time pass-by-reference has been removed in /var/www/html/MoodleWWW/blocks/ilp/classes/plugins/ilp_graph_plugin.class.php on line 95

----------

I have tried renaming the plugins folder but this does not make any difference.

Does anyone know why I am getting these errors and how I can resolve it so I can login.

Thank you for your assistance.
Peter

In reply to Peter Mills

Re: Moving from Mac OS X to Linux Virtual and Upgrading

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Hi Peter

Very good, that you identified the two things involved:
a. https://docs.moodle.org/23/en/Moodle_migration
b. https://docs.moodle.org/27/en/Upgrading

Lot of people want take those two steps in one, and land short.

Your question on the order. For Moodle there is no difference, as long as the platform satisfies the https://docs.moodle.org/dev/Moodle_2.3_release_notes#Requirements and https://docs.moodle.org/dev/Moodle_2.7_release_notes#Server_requirements. Personally I would first migrate to Linux and then upgrade, simply because I know Linux better.
In reply to Peter Mills

Re: Moving from Mac OS X to Linux Virtual and Upgrading

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers

Ken gave you some very good thoughts.  Maybe I can add to this.

For the last 6 weeks, I have been working on a fresh copy of Moodle 3.0.  I have been doing this on my Mac, under MAMP.  About a week ago, I moved it to my CentOS Linux server.  Yesterday, students started self-enrolling on my Linux moodle and all is going well.  So what you want to do might be possible.  You should experiment and give it a try.

Yes, I would recommend upgrading your moodle to the one that you will be running on your Linux server, hopefully the latest moodle3.  Make sure to have backups of everything before you begin.

I like to install a fresh copy of moodle on my linux server.  I add plugins to match the one that I will be moving.  Then I dump the Mac database, zip the Mac moodledata folder, and move these to my Linux server.  Then, on the Linux side, I drop all of the database table sand import my Mac's database.  On the Linux server, I erase the moodledata folder and replace it with my Mac's. I don't touch the moodle program on Linux (keep its config.php file.)  I start moodle and let it get its head straight.  Well, this works.  I did all of my development on my Mac, then moved it to my VPS.

Maybe this works because both my Mac and Linux are Apache, php, and mySQL.  I think this is what Ken is getting to, that this might not work if you are going from, let's say, Apache, php, and mySQL to MS servers, php, and some other database.  I think you know what I mean.

But the best way to know is to try it.  I would start by duplicating your Moodle 2.3 on your current sever and preserve your original, just in case the upgrades clobbers you.  There were some significant changes along the way.  I have been upgrading my moodle about every other month since version 2.0, so I haven't had to make a big jump.  But I do recall at some point, some major changes in themes.  Maybe around 2.4 or so.  This is when I switched to the MORE theme.  So you have a fairly significant learning curve.  But go through the recommended upgrade steps and test each upgrade.