SQL Query to import data from old mdl_user.csv

SQL Query to import data from old mdl_user.csv

by Anil Karwankar -
Number of replies: 4

I am on Moodle 4.0 and have old moodle users in mdl_user.csv format I want to import this csv file  using new moodle adminer New Moodle database. Please help me in sql query because direct import of csv is not there as it was a great feature of phpmyadmin 

Average of ratings: -
In reply to Anil Karwankar

Re: SQL Query to import data from old mdl_user.csv

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers
I am not sure how you used to import users, but in Moodle 4.0 (which is still developmental) you can still go to Admin| Users | Accounts | and finally upload users (in a csv file). An example csv file is provided on that web page.

There is no need to use a SQL query. Perhaps this worked for you in the past, but I would recommend using Moodle's features to do this.
In reply to Rick Jerz

Re: SQL Query to import data from old mdl_user.csv

by Anil Karwankar -
Thanks Rick that csv file adds only new users with limited field but my problem solved There is an import csv file option in Adminer Double click on Table in left hand side and Import option is available at right window at bottom
In reply to Anil Karwankar

Re: SQL Query to import data from old mdl_user.csv

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers
Great, Anil! You probably know what you are doing by importing directly into Moodle's user table. If one doesn't know which tables are affected by a SQL import query, you can really mess up your Moodle.