← Back to team overview

dhis2-users team mailing list archive

Re: Creation of bulk user.

 

Alright. Are you using postgres? If not, this will not work.

1.
Select the by pressing the select button.

2.
In this case, the firstname and surname is in the csv file. Surname in the
first column, 0, and firstname in the second column, 1. Select the csv
radio button and the right column. Probably already selected.

3.
The username can be made by a combination of the firstname and lastname,
then select split+count. If some are equal, numbers will be added.

4.
The random password should just create a random password.
!This is not secure random, just a random string from java!

5.
One needs to enter the right database connection parameters in order to
load user roles and orgunits. Or one can use organization unit id or code
from the database. The id can be found in the database, codes are usually
made manually in DHIS2. We used the codes from the csv file to assign
orgunits, column 19.

6. Enter the correct database parameters.

7. Exclude incomplete users will not create users that are missing some of
the information.

8. Make csv of imported users, creates a csv file with the usernames and
passwords.

9. Make csv of incomplete records creates a csv file with the users that
are missing data.

10. The files can be found in the same directory as the selected file.

Let me know if there are any trouble.



2014-05-09 7:00 GMT+02:00 Hannan Khan <hannank@xxxxxxxxx>:

> Thanks Randy
>
> We are trying with Kenneth's Java application; if we have the sample csv
> file it will be very help full for us.
>
> Dear Kenneth
>
> Can you please send me a sample CSV file.
>
> Regards
>
> Hannan
>
>
> On Thu, May 8, 2014 at 6:58 PM, Wilson,Randy <rwilson@xxxxxxx> wrote:
>
>>  Hi Hannan,
>>
>>
>>
>> I think you should try Kenneth’s java application.  We created 40,000
>> users (community health workers with their phone numbers and orgunit link)
>> and assigned them all passwords using the app.  I think Kenneth has put in
>> a User interface that lets you specify the server address, DHIS-2 instance
>> or database, etc…
>>
>>
>>
>> Kenneth could you send Hannan a sample csv file (just 10 records or so)
>> along with your application, so he can test it out.  I think it is
>> sufficiently generic.
>>
>>
>>
>> He sent a link to it in an earlier response.  This file is quite big – 54
>> meg - Kenneth, can it be shrunk a bit more?
>>
>>
>>
>> If you have java on your Windows computer you should be able to run it as
>> follows:
>>
>>
>>
>> Java –jar user_importer.jar
>>
>>
>>
>> Randy
>>
>>
>>
>> *From:* Dhis2-users [mailto:dhis2-users-bounces+rwilson=
>> msh.org@xxxxxxxxxxxxxxxxxxx] *On Behalf Of *Hannan Khan
>> *Sent:* Thursday, May 08, 2014 1:09 PM
>> *To:* Lars Helge Øverland
>> *Cc:* dhis2-users@xxxxxxxxxxxxxxxxxxx; DHIS 2 developers
>> *Subject:* Re: [Dhis2-users] Creation of bulk user.
>>
>>
>>
>> Hi Lars
>>
>>
>>
>> Thanks. Yes restarting tomcat can generate the blank UID.
>>
>>
>>
>> UID is a indexed field so I cannot create more than one user in one go.
>> Is there any solution?
>>
>>
>>
>> Regards
>>
>>
>>
>> Hannan
>>
>>
>>
>> On Wed, May 7, 2014 at 2:38 PM, Lars Helge Øverland <larshelge@xxxxxxxxx>
>> wrote:
>>
>> Hi,
>>
>>
>>
>> it is correct that missing UIDs will be generated on system startup.
>>
>>
>>
>> I think what is being referred to here is dhis UID and not an UUID. There
>> are ways to generate dhis UIDs through the web api but it's just much
>> simpler to restart tomcat.
>>
>>
>>
>> regards,
>>
>>
>>
>> Lars
>>
>>
>>
>>
>>
>> On Wed, May 7, 2014 at 10:19 AM, Knut Staring <knutst@xxxxxxxxx> wrote:
>>
>> The easiest is to restart DHIS2 (Tomcat)
>>
>>
>>
>> On Wed, May 7, 2014 at 10:14 AM, Jason Pickering <
>> jason.p.pickering@xxxxxxxxx> wrote:
>>
>> If it is blank then the database will regenerate it automatically when
>> you restart (I think. This is what happens with other objects which have a
>> uuid). That is the easiest way.
>>
>>
>>
>> If you are preparing SQL for injection of the users and you want to
>> pregenerate them, you can use which ever tool you are using to generate the
>> SQL to provide you UUIDs as well. Postgresql's uuid-ossp package, R's
>> "uuid" package, or the system command "uuid" on Linux are all ways of
>> getting them. I am sure they can be done easily in Java or other languages.
>> So, it really depends on which tools you are using to prepare the SQL for
>> inserting them into the DHIS2 database.
>>
>>
>>
>> Regards,
>>
>> Jason
>>
>>
>>
>>
>>
>> On Wed, May 7, 2014 at 10:07 AM, Hannan Khan <hannank@xxxxxxxxx> wrote:
>>
>> No. It seems that uuid is not automatically generated. Please suggest.
>>
>> Regards
>>
>> Hannan
>>
>> On May 7, 2014 1:34 PM, "Jason Pickering" <jason.p.pickering@xxxxxxxxx>
>> wrote:
>>
>> The UUID will be generated automatically, so no need to worry about it.
>>
>>
>> Regards,
>>
>> Jason
>>
>>
>>
>>
>>
>> On Wed, May 7, 2014 at 9:29 AM, Hannan Khan <hannank@xxxxxxxxx> wrote:
>>
>> Thanks Jason. Password issues are there and we are trying with that but
>> what about the UUID?
>>
>>
>>
>> Regards
>>
>>
>>
>> Hannan
>>
>>
>>
>> On Wed, May 7, 2014 at 12:14 PM, Jason Pickering <
>> jason.p.pickering@xxxxxxxxx> wrote:
>>
>> Hi Hannan,
>>
>> This has been discussed (again) recently on this list.
>>
>>
>>
>>
>> http://dhis-developers-list.1563109.n2.nabble.com/Password-Generation-td7590749.html#a7590750
>>
>>
>>
>>
>> http://dhis-developers-list.1563109.n2.nabble.com/USERS-Password-td7591703.html#a7591704
>>
>>
>>
>> There are a few more as well in the archives if you dig a bit.
>>
>>
>>
>> Regards,
>>
>> Jason
>>
>>
>>
>>
>>
>> On Wed, May 7, 2014 at 8:10 AM, Hannan Khan <hannank@xxxxxxxxx> wrote:
>>
>>   Dear Experts
>>
>>
>>
>> We are in a need of creating bulk users (8000) and org unit assignment. I
>> created script for testing but facing problem populating password and UUID.
>> Please advice how can I do that?
>>
>>
>>
>> I try to update password using crypt function and gen_salt function but
>> the length of the password are different and doesn't working. Please advise.
>>
>>
>>
>> Regards
>>
>>
>>
>> *Hannan Khan*
>>
>> --------------------------------------------------
>>
>> Senior Technical Advisor - Health Information Systems
>>
>> Health Sector
>>
>> Deutsche Gesellschaft für Internationale Zusammenarbeit (GIZ) GmbH
>>
>> House10/A, Road 90, Gulshan 2, Dhaka 1212, Bangladesh
>>
>>
>>
>> T +880-2- 8816459, 8816412 ext 118
>> F +88 02 8813 875
>>
>> M+88 01819 239 241
>>
>> M+88 01534 312 066
>> E hannan.khan@xxxxxx
>>
>> I   www.giz.de
>>
>> S hannan.khan.dhaka
>>
>> B hannan-tech.blogspot.com
>>
>>
>>
>> _______________________________________________
>> Mailing list: https://launchpad.net/~dhis2-users
>> Post to     : dhis2-users@xxxxxxxxxxxxxxxxxxx
>> Unsubscribe : https://launchpad.net/~dhis2-users
>> More help   : https://help.launchpad.net/ListHelp
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> --
>>
>> Knut Staring
>>
>> Dept. of Informatics, University of Oslo
>>
>> +4791880522
>>
>> http://dhis2.org
>>
>>
>>
>>
>>
>
>
SURNAME,GIVEN NAME,ROLE,SEX,NATIONAL ID,TELEPHONE MOH,Validity of phone number,VILLAGE,CELL,SECTOR,sectorcode,HEALTH CENTRE,REFERRAL HOSPITAL,DISTRICT,PROVINCE,FOSAID,sectorcellkey,cellvillagecode,sectcellvillage,villagecode,parentid
MUKANKAKA  ,VESTINE  ,Binome,F,1195770026132022,250782930862,,Mwunguzi,Kamina,Murundi,030107,Munzanga,Kirinda HD,Karongi,WESTERN PROVINCE,171,MurundiKamina,MurundiKamina,MurundiKaminaMwunguzi,0301070304,12305
kabanyana  ,agnes  ,Binome,F,1196070062571078,250782924107,,Rubirizi,Nsinda,Muhazi,050106,Gishari/ Police,Rwamagana HD,Rwamagana,EASTERN PROVINCE,354,MuhaziNsinda,MuhaziNsinda,MuhaziNsindaRubirizi,0501060703,11441
KABAHIZI , JEAN,Binome,F,1198180133047081,25078292431,invalid,Ruhita,Nyakabanda,Musha,050109,Musha (RWAMAGANA),Rwamagana HD,Rwamagana,EASTERN PROVINCE,357,MushaNyakabanda,MushaNyakabanda,MushaNyakabandaRuhita,0501090602,12704
MUNYAMPENDA  , Pierre,Binome,M,1195980030169030,250782932777,,Murikwa,Cyimanzovu,Shyira,030412,Shyira,Shyira HD,Nyabihu,WESTERN PROVINCE,221,ShyiraCyimanzovu,ShyiraCyimanzovu,ShyiraCyimanzovuMurikwa,0304120105,17644
UWAMAHORO ,Sarah  ,Binome,F,1197270043325000,250782932817,,Mataba,Kanyamitana,Shyira,030412,Shyira,Shyira HD,Nyabihu,WESTERN PROVINCE,221,ShyiraKanyamitana,ShyiraKanyamitana,ShyiraKanyamitanaMataba,0304120205,17649
KABISAMA ,Bernardine,ASM,F,1197570009201050,250782940769,,Jyambere,Karambo,Gatenga,010302,Bethsaida ,Masaka DH,Kicukiro,KIGALI CITY,29,GatengaKarambo,GatengaKarambo,GatengaKaramboJyambere,0103020203,6212
NTEZIRYAYO ,EMMANUEL  ,Binome,F,1197680086657015,250788924935,,,,Gahengeri,050102,Gahengeri,Rwamagana HD,Rwamagana,EASTERN PROVINCE,497,Gahengeri,#I/T,Gahengeri,#I/T,#I/T
UWAMAHORO  ,Florance  ,Binome,F,1197970097706049,250872937927,,Kiringa,Musenyi,Musenyi,050706,Gakurazo,Nyamata HD,Bugesera,EASTERN PROVINCE,446,MusenyiMusenyi,MusenyiMusenyi,MusenyiMusenyiKiringa,0507060209,12609
NTAMUHEZA ,Vestine  ,ASM,F,1197970118354020,250182919795,,Ndora ,Buheta ,Gakenke ,040204,Rukura,Ruli HD,Gakenke,NORTHERN PROVINCE,300,Gakenke Buheta ,Gakenke Buheta ,Gakenke Buheta Ndora ,0402040109,5871
UMUGWANEZA  ,MARIE GRACE,ASM,F,1198070158095090,205782933691,,Kabyaza,Rurengeri,Mukamira,030407,Rwankeri,Shyira HD,Nyabihu,WESTERN PROVINCE,220,MukamiraRurengeri,MukamiraRurengeri,MukamiraRurengeriKabyaza,0304070701,11697
MUKASHYAKA ,CHANTAL  ,ASM,F,1198670062049027,205782934904,,Bisengo,Rwambogo,Butare,030602,Nyabitimbo,Mibilizi HD,Rusizi,WESTERN PROVINCE,250,ButareRwambogo,ButareRwambogo,ButareRwambogoBisengo,0306020401,4727
MUKAMPARIRWA , CLAUDETTE,Binome,F,1197670046258091,207829244341,,Rugabano,Akabare,Musha,050109,Musha (RWAMAGANA),Rwamagana HD,Rwamagana,EASTERN PROVINCE,357,MushaAkabare,MushaAkabare,MushaAkabareRugabano,0501090106,12681
NYIRANSABIMANA  ,Providence  ,Binome,F,1196270051957089,250782919189,,Gisovu ,Nyundo ,Rusasa ,040218,Nyundo,Nemba HD,Gakenke,NORTHERN PROVINCE,299,Rusasa Nyundo ,Rusasa Nyundo ,Rusasa Nyundo Gisovu ,0402180403,16772
ZIBUKIRA  ,Adonie  ,Binome,F,1196180037216084,250782919220,,Nyange ,Murambi ,Rusasa ,040218,Nyundo,Nemba HD,Gakenke,NORTHERN PROVINCE,299,Rusasa Murambi ,Rusasa Murambi ,Rusasa Murambi Nyange ,0402180304,16769
TUYISHIMIRE  ,Vestine  ,ASM,F,1198470133350018,250782921474,,Kadendegeri,Bwimo,RUKOZO,040114,Rukozo,Kinihira DH,Rulindo,NORTHERN PROVINCE,279,RUKOZOBwimo,RUKOZOBwimo,RUKOZOBwimoKadendegeri,0401140204,16479
UWIMANA  ,DIDANCIENNE  ,ASM,F,1197170064590038,250782901717,,Nyarubuye,Karenge,Kabarore,050304,Kabarore,Kiziguro HD,Gatsibo,EASTERN PROVINCE,391,KabaroreKarenge,KabaroreKarenge,KabaroreKarengeNyarubuye,0503040303,7587
PANTALEON  ,UWIMANA  ,Binome,M,1196180000635026,250782913967,,Rubona,Gishweru,Mwendo,020607,Gishweru,Gitwe HD,Ruhango,SOUTHEN PROVINCE,114,MwendoGishweru,MwendoGishweru,MwendoGishweruRubona,0206070205,13136
NGARAMBE  ,EDUARD  ,Binome,M,1195580021210811,250782933552,,Humiro,Ryinyo,Kintobo,030406,Rwankeri,Shyira HD,Nyabihu,WESTERN PROVINCE,220,KintoboRyinyo,KintoboRyinyo,KintoboRyinyoHumiro,0304060603,9737
NYIRARUDODO  ,GAUDENCE  ,Binome,F,1197170032198025,250782933568,,Gasyo,Kintobo,Kintobo,030406,Rwankeri,Shyira HD,Nyabihu,WESTERN PROVINCE,220,KintoboKintobo,KintoboKintobo,KintoboKintoboGasyo,0304060204,9719
Vestine  ,NYIRANZABAHIMANA  ,ASM,F,1198070090087028,250782943431,,Gakeri,Mberi,Rusebeya,030213,Kabona,Murunda HD,Rutsiro,WESTERN PROVINCE,181,RusebeyaMberi,RusebeyaMberi,RusebeyaMberiGakeri,0302130202,16835
Barakagwira ,Jacqueline ,ASM,F,1198170135051033,250782901666,,Gisaka,Bukomane,Gitoki,050303,Kabarore,Kiziguro HD,Gatsibo,EASTERN PROVINCE,391,GitokiBukomane,GitokiBukomane,GitokiBukomaneGisaka,0503030104,7017
NYIRANGARUYE , Dorothée,ASM,F,1196570030505030,250762918170,,Shusho,Mahoko,Kanama,030305,Karambo (RUBAVU),Gisenyi HD,Rubavu,WESTERN PROVINCE,200,KanamaMahoko,KanamaMahoko,KanamaMahokoShusho,0303050312,8063
MUKAMANA ,Cecile ,Binome,F,1197170070639013,250782926576,,Murisanga,Kivumu,Gisenyi,030304,Gisenyi,Gisenyi HD,Rubavu,WESTERN PROVINCE,198,GisenyiKivumu,GisenyiKivumu,GisenyiKivumuMurisanga,0303040307,6692
NYIRAHABIMANA  ,CLEMENTINE  ,Binome,F,1197870081535022,250782915369,,Gakenke,Nturo,Rwaza,040314,Nyakinama,Ruhengeri HD,Musanze,NORTHERN PROVINCE,315,RwazaNturo,RwazaNturo,RwazaNturoGakenke,0403140401,17212
M.Chantal ,Uwidutije ,Binome,F,1198070008880032,2507800000000,invalid,Karuruma,Kabuye,Jabana,010205,Kabuye,Kibagabaga HD,Gasabo,KIGALI CITY,17,JabanaKabuye,JabanaKabuye,JabanaKabuyeKaruruma,0102050306,7184
TUYIRINGIRE ,DATIVE  ,Binome,F,1197870115552052,250781924846,,Gitanu,Akanzu,Nzige,050113,Nzige,Rwamagana HD,Rwamagana,EASTERN PROVINCE,361,NzigeAkanzu,NzigeAkanzu,NzigeAkanzuGitanu,0501130106,15224
LIBEREE  ,UWIFASHIJE  ,ASM,F,1198070065211045,250781936280,,Kazibira,Gako,Kagano,030705,Nyamasheke,Kibogora HD,Nyamasheke,WESTERN PROVINCE,267,KaganoGako,KaganoGako,KaganoGakoKazibira,0307050104,7742
Mukamuganga  ,Annonciate  ,Binome,F,1195970054598011,250782007998,,Nyarubuye Ii,Nyarutunga,Nyarubuye,050512,Nyarubuye (KIREHE),Kirehe HD,Kirehe,EASTERN PROVINCE,430,NyarubuyeNyarutunga,#I/T,NyarubuyeNyarutungaNyarubuye Ii,#I/T,#I/T
MUKANDEKEZI  ,Marie Louise,Binome,F,1197070054262095,250782014984,,Rugandu,Muhotora,Butaro,040402,Butaro,Butaro HD,Burera,NORTHERN PROVINCE,321,ButaroMuhotora,ButaroMuhotora,ButaroMuhotoraRugandu,0404020310,4771

Follow ups

References