Best approach - migrating courses and configurations

Best approach - migrating courses and configurations

by Jerry Lau -
Number of replies: 4

Hello everyone.

We have decided to move/migrate our existing Moodle 3.6.x platform in-house to service provider instead.

This is a good thing as this gives us a chance to clean things up.

We need some feedback / recommendations on the best way of doing the migration.

What is reasonably fast, safe and efficient way that we could transfer over courses that have been identified by our users that want to keep and migrate their courses, so that we don’t have to do it one-by-one manually?

If we move the entire database, that defeats the purpose of  clean-up before migration as a our database is large. We want to do this before migration.

What about settings and configurations? Can we just "migrate" them? I think this should be easier as all settings are in the database and can be migrated and restored at the new platform, no?

Recommendations?

Thanks!






Average of ratings: -
In reply to Jerry Lau

Re: Best approach - migrating courses and configurations

by Ken Task -
Picture of Particularly helpful Moodlers

Is 'service provider' a Moodle Partner or quasi-Moodle Partner?

IF so, would think they might have a solution/method(s).

If not ... a quickie ...

New Server - stand up a fresh git installed 3.6.highest version of Moodle.  No teachers ... only unique admin level users that don't exist in current server.

Install moosh on it.

Current server ... each teacher desiring to keep, resets courses removing students ... that includes their work, files uploaded, grades, events, etc.

A list of those course ID's created.

From command line on current server use cli backup.php script to loop through those reset courses and save them to a designated directory (not in moodledata/filedir).  That designated directory is temporarily set with symlink so it's accessible via web.

Using command line create a listing of all backup files contained there in.

On new server ... create a file system repo called 'restores'.

From 'restores' use wget which gets each course backup to the 'restores' repo.

On new server,  use moosh to run through a a listing of courses to be restored to a category.

If all goes well, on new server, teacher has same creds, logs into new, and their transferred courses are ready for further updating/editing + assigning studnets (you probably have already some method of doing that via Student Info System so teachers may not need to do a thing).

Sounds involved but better than GUI and doing one at a time.  In the past, did exactly as described above ... 'moved' 4000+ courses to new server in a little over 8 hours ... adjusting scripts used on either server (plus a pot or two of coffee ... late night job).

'SoS', Ken




In reply to Ken Task

Re: Best approach - migrating courses and configurations

by Ken Task -
Picture of Particularly helpful Moodlers

Follow up ... probably should have prefaced response with question of what 'best approach' means to Op ... ok, posted previous response without .. oh, well.

Another 'best'??? almost all gui way ...

Current site ... new cateogry for 'to delete courses'.  Move all courses not to make journey into there.  Delete category and all courses.   Forcibly remove/contend with recyclebins and trashdir.  If server admin doesn't, have to wait for cron jobs/task to kick in or force running of those - 2 to 4 day wait if not.

Have all teachers reset courses they desire to use in new being sure they include students and their work.

Clone cleaned up site and move those backups to new server.   Restore site.   Perfect time to sideload git.

Finish clean up/checking settings, etc.

Server FQDN same?  Use hostfile trick to work on new server by FQDN until completed (something I didn't mention in prevous posting).   Change DNS.

Old site still available for CLI things but no longer available by FQDN/GUI.

Still have dedicated RHEL 6 boxen for DB server/web?

To add confusion but 'future proof'????  RHEL 7 or maybe time to save some bucks and go CentOS 7.

All in all guess 'best' kinda like other things Moodle ... what can admin's do ... etc.

Anyhooo ...

'SoS', Ken


In reply to Jerry Lau

Re: Best approach - migrating courses and configurations

by Ken Task -
Picture of Particularly helpful Moodlers

In remembering your former posting topics, seems a lot of time was spent 'tweaking' DB settings.   So a key here is 'configurations', maybe?

When moving to a different provider are sounds like you're not getting a minimal OS install and you build, but they have already 'built' for you ... web service, DB server and MySQL/MariaDB already loaded and server waiting your moodle backups?

You can copy the my.cnf file to new server, but, been my experience, perhaps best *not* to just drop it in and expect everything ot work .... unless ... new digs are *exactly* the same - and that happens how often? (almost none).  Same goes for web server and config files for it.

Do locate your cert files and do copy them to new server if keeping same FQDN and CA.

A old server running MySQL and new server running MariaDB (supposed to be a 'drop in replacement') some lines meant for MySQL actually don't work with MariaDB and some new ones might be needed.   

Besides ... perfect time to upgrade the DB version ... if MySQL also perfect time to use MySQL's own repo's.

Found that 5.7 of that flavor's defaults have changed and some of the config settings for older versions no longer needed.

Large DB ... what's size of sql dump?   While not an exact does clue one in on possible (nohup) command additions and config tweaks.

Could reduce size before migrating .sql dump to new DB server by truncating the largest table ... mdl_logstore_standard_log ... the 'who done it' table.

Would install MySQL Tuner from the get go and run it + save output ... probably the first opportunity you've had to have a 'baseline' for config before exploring tweaks to config (which may/may not be helpful in new environment).

And another 2 cents ... provider in the 'cloud'.  Now there are some additional considerations ... for dedicated DB server config ... what host can access, reduced surface for attacks, should it use encrypted transport?  Is cloud provider known for 'noisy neighbors'?

Oh, yeah ... docs do mention rsysnc ... good option for moodledata.   Just make sure you do a dry run first. ;)

'SoS', Ken