We have been using version 1.9 for along time and just now went to 3.0. We did a clean install since this was the smoothest and recommended option. The problem with that is that we have 1000's of users in our old DB and need to migrate them somehow to the new system and DB. Has anyone encountered this problem or know of the best way to do this? thanks
Getting just the users and all the fields in their profiles moved from 1.9 to 3.0 is pretty easy. Under site administration go to users > accounts > bulk user actions. Once on that page in the, Users in list section, click on All users, in the, Available, box. Then click the, Add to selection, button. Once all the names are showing in the selected box, change the, With selected user, drop down to, Download, and click, Go.
Pick your preferred format for the download, text, ODS, or Excel to get a csv file containing all the info for your users.
BEFORE you use the csv file to go to your Moodle 3.0 Site administration > Users > Upload users, you should deleted the column in the file labeled 'id' as your new Moodle site will assign those automatically. 'id' is not one of the fields you can define and use for bulk upload of users.
NOTE: I would try just a few users first to make sure I was doing this process correctly. Plus, with thousands of users, you might run into 'timeout' problems so you might want to break the process up into small chunks of users.
that download process does not affect the old DB right? it is simply printing out the values I assume. But im not realy sure how to get the right information to propagate through the other tables?
Hi Robby,
I've done this a number of times. Here's some very important tips:
- Put the 1.9 and 3.0 Moodles in maintenance mode when performing large operations like this.
- Turn on error reporting, otherwise any script time-outs or hitting memory limits will make backups, restores, imports, and exports fail silently. Without error reporting, you'll have no idea if the operations completed successfully or not.
- If you can, increase the php.ini:
- memory_limit=1024M; (or 2048M+ if your server has the capacity)
- max_execution_time=360; (1 hour is more than enough)
- And the MySQL or equivalent my.cnf:
- max_allowed_packet=512M (or higher)
- Basically the settings should be as high as your server's capacity will allow, also allowing for the OS and other services overhead. Don't forget to restart PHP and MySQL for the changes to take effect.
- Whatever maximum resources you can dedicate to PHP and MySQL, start the exports with small numbers and increase until the exports fail, then reduce that number by 1/3 or more to allow for differences in server resource usage each time the export script is run.
And when doing large operations like this, don't forget to test, test, test at every stage, i.e. make sure that the output files are what you expect them to be and can be restored/imported without any issues. It's time consuming but not as much as losing data and having to start over.
And yes, the export only prints out copies of the DB entries so the original DB tables are left intact.
Re: "But im not realy sure how to get the right information to propagate through the other tables?" -- Backing up the users will not backup their course or grades data, only their profile information. If you want to keep everything in the DB, make a clone of the Moodle 1.9 + DB and go through the upgrade process on that. This will keep your courses, files, gradebook, users, settings, etc. more or less as they are:
- https://docs.moodle.org/20/en/Upgrading_to_Moodle_2.0
- https://docs.moodle.org/22/en/Upgrading_to_Moodle_2.2
- https://docs.moodle.org/30/en/Upgrading
Also check that you can upgrade data from any 3rd party plugins that you might have installed. Not all plugins are supported between 1.9 and 3.0.
I hope this helps!