Migrating Users from Existing Moodle Instance to a New Moodle Instance

Migrating Users from Existing Moodle Instance to a New Moodle Instance

by Joe Tyler -
Number of replies: 4

Here is our scenario: We have two separate moodle instances... one that is our current production moodle and another that is our staging moodle, which will go into production in the near future. Awhile back, we decided not to copy or upgrade any of our existing data (multiple reasons for that). So now we have a production moodle and a freshly installed moodle, with no data. Recently it has become important for us to have our current users from our production moodle migrated into our new moodle so we can pre-stage some content for our courses, which tie back to the moodle user. The moodle user must exist in order for this process to happen. Is this possible? If so, how would I best go about doing so (sql export ... sql import)? Is it recommended? Any help is appreciated. Thanks! -- Joe

Average of ratings: -
In reply to Joe Tyler

Re: Migrating Users from Existing Moodle Instance to a New Moodle Instance

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

Do you need the users to still connect to old data that you are planning to import or do you just need the users in there?

If the latter, you could just export from the old moodle and then upload by csv to the new moodle.  The process will reset passwords but you can just change them all to changeme and force password change on first login - a good thing to do every once in a while anyway.

If you need them to connect to old courses, then just import the old course with users attached.

Average of ratings: Useful (1)
In reply to Emma Richardson

Re: Migrating Users from Existing Moodle Instance to a New Moodle Instance

by Joe Tyler -

Emma, Thanks for the helpful reply. I do not need the users to connect to old data. Is there an easy way to export when there are thousands of users? All users are tied to a directory service, so shouldn't need to set the password.

In reply to Joe Tyler

Re: Migrating Users from Existing Moodle Instance to a New Moodle Instance

by Sam Stevens -

All under Site Admin > Users > Accounts

under Bulk User Actions you can add all users and then choose the download option. Save it to a csv. 

Then on the new system same section choose Upload Users and give it the csv.


Never used it though. There is an option to preview and I would do a db backup of the site you are moving them to just in case. 

In reply to Sam Stevens

Re: Migrating Users from Existing Moodle Instance to a New Moodle Instance

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

The upload csv option works well.  It will not bring across passwords but I suggest just setting them all the changeme which will force a password change on first log in.