Loading...
 
Architecture / Installation

Architecture / Installation


Migration of trac users to tiki

posts: 4 Germany

Hello,
I have to migrate a Project on Trac to Tiki. I have managed to migrate the wiki-pages and the files are also stored in a file gallery. So far so good.
The problem I have now is that I have to migrate the registered Useraccounts to tiki. On the old trac instance, the passwords were stored as an MD5 hash (htdigest), but as far as I know tiki only supports blowfish since release 9.
So my question is: How can I store the old MD5 hashes in the user_user table? Does anyone have an idea?

PS: I want the users to change their passwords afterwards, since MD5 is not the state of the art anymore. But there is no possibility to contact them all first.

posts: 4 Germany
I already tried to store it in the table users_users, once with no prefix, so the plain hash, and once with the php specific prefix $1$. Both did not work, only the unsuccessful_login var raises ;)
posts: 4 Germany

OK, since noone can help me, I am considering to move away from tiki since this is the real dealbreaker for me: Making it possible to use the old accounts from trac. Maybe with an option to send a new password or anything else, so that it will be stored in the database of tiki properly.

Maybe someone will find this usefull to migrate, these are (partly) the steps I did to migrate. I used a dump of the database of trac for this, than created the tables users_users, users_usergroups and tiki_user_preferences, than exported them as a .csv and imported them into the tiki database:

INSERT INTO users_users ('login', 'lastLogin')
SELECT sid AS login, last_visit AS lastLogin
FROM session;

UPDATE users_users
SET email=( SELECT value
FROM session_attribute
WHERE name='email' AND
session_attribute.sid=users_users.login);



DROP TABLE IF EXISTS temp.a;
CREATE TABLE temp.a (
"user" TEXT,
"prefName" TEXT,
"value" TEXT
);
INSERT INTO temp.a (user)
SELECT login FROM users_users;
UPDATE temp.a
SET prefName='realName';
UPDATE temp.a
SET value=(SELECT value
FROM session_attribute
WHERE name='name' AND
temp.a.user=session_attribute.sid);

INSERT INTO temp.a (user)
SELECT login FROM users_users;
UPDATE temp.a
SET prefName='user_information',
value='private'
WHERE prefName is NULL;

INSERT INTO temp.a (user)
SELECT login FROM users_users;
UPDATE temp.a
SET prefName='email is public',
value='n'
WHERE prefName is NULL;

INSERT INTO temp.a (user)
SELECT login FROM users_users;
UPDATE temp.a
SET prefName='mailCharset',
value='utf8'
WHERE prefName is NULL;

INSERT INTO temp.a (user)
SELECT login FROM users_users;
UPDATE temp.a
SET prefName='allowMsgs',
value='n'
WHERE prefName is NULL;

INSERT INTO temp.a (user)
SELECT login FROM users_users;
UPDATE temp.a
SET prefName='display_12hr_clock',
value='n'
WHERE prefName is NULL;

INSERT INTO temp.a (user)
SELECT login FROM users_users;
UPDATE temp.a
SET prefName='show_mouseover_user_info',
value='n'
WHERE prefName is NULL;

INSERT INTO tiki_user_preferences (user,prefName,value)
SELECT user,prefName,value
FROM temp.a
ORDER BY user ASC;

DROP TABLE temp.a;

+++++++++++++++++++++++++++++++++++++++++++++++++

Die Gruppenzugehörigkeit wird bei tikiwiki in der Tabelle users_usergroups gespeichert, bei Trac in der Tabelle permission:

+++++++++++++++++++++++++++++++++++++++++++++++++

INSERT INTO users_usergroups (userId,groupName)
SELECT username AS userId, action AS groupName
FROM permission;

UPDATE users_usergroups
SET userId = (SELECT userId
FROM users_users
WHERE users_usergroups.userId=users_users.login);

In der Tabelle permission ist noch authenticated, admin und anonymous aufgeführt. Diese Einträge müssen gelöscht werden.

DELETE FROM users_usergroups
WHERE userId is NULL OR userId='1';