[dokuwiki] Re: Migrate users from MySQL

  • From: Chris Smith <chris@xxxxxxxxxxxxx>
  • To: dokuwiki@xxxxxxxxxxxxx
  • Date: Wed, 27 Dec 2006 15:31:44 +0000

Mário Gamito wrote:
Hi,

I have this site running LAMP.
I'm changing it to dokuwiki.
I have the list of my users in MySQL, being the passwords in clear text.

My question is: how to migrate them to dokuwiki ?

I know how to make a file with usernames and passwords from MySQL.

What i'm asking is after that. How to insert them in dokuwiki in Group user ?

Any help would be appreciated.

Warm Regards,
Mário Gamito
My email provider's been a bit patchy, I've seen all the replies a while back, but I never saw the original question until now.

Hi !

You should be able to construct an SQL statement to retrieve your user details in a format suitable for saving as a dokuwiki users file. I use the MySQL Query Browser, it allows export of a dataset in CSV format, from where you can do a search replace to get DW's colon separated format, or you can concatenate the strings in your SQL statement.

e.g.

SELECT user, md5(password), username, email, "user" FROM my_user_table;

or

SELECT concat(user,":",md5(password),":",username,":",email,":user") FROM my_user_table

By including a string "user" in the field list and in the concat() you are assigning every user to the group "user".

If your dokuwiki conf directory is below your webroot, for security, when saving the file, add a line at the top "#<?php die()?>".

Cheers,

Chris
--
DokuWiki mailing list - more info at
http://wiki.splitbrain.org/wiki:mailinglist

Other related posts: