留言板

copy encrypted passwords between different liferay installations.

thumbnail
Michele Zanarotti,修改在10 年前。

copy encrypted passwords between different liferay installations.

Junior Member 帖子: 94 加入日期: 12-2-20 最近的帖子
Hello.
I recently had the task to export all users to a new liferay installation (from 6.0 to 6.1 GA3).
To test how to port passwords I created a user thorugh UI and copied the password_ field from the origin database through a sql update :

update User_ set password_ = '{original_encrypted_password}' where screenName = 'testUser';

This works as expected ! I'm able to enter and sign in to Liferay with the original password from the previous installation. I wanted to ask if this is the correct way to change the password (UI excluded). I'm doubtful about the field 'digest' in the User_ table. What's its meaning ?
I fear some drawbacks in this solution.
thumbnail
David H Nebinger,修改在10 年前。

RE: copy encrypted passwords between different liferay installations.

Liferay Legend 帖子: 14918 加入日期: 06-9-2 最近的帖子
you should never ever do things directly in the database.

Liferay has an export function to export users, just use the export/import process to handle what you're trying to do.
thumbnail
Michele Zanarotti,修改在10 年前。

RE: copy encrypted passwords between different liferay installations.

Junior Member 帖子: 94 加入日期: 12-2-20 最近的帖子
Sorry, i didn't notice an export/import utility for users.

Can you point me in the right direction to do that ?

Thanks.
thumbnail
Manish Yadav,修改在10 年前。

RE: copy encrypted passwords between different liferay installations.

Expert 帖子: 493 加入日期: 12-5-26 最近的帖子
Hi Michele Zanarotti,

You can export user in CSV file format from control panel User and Organisation .Copy below property in portal-ext.properties and add fields name which you want to extract.
users.export.csv.fields=fullName,emailAddress,password

Import Users is not available as OTB features in liferay. You can create Custom portlet which will take csv file as input and add users in your portal (Hint UserLocalServiceUtil.addUser() method.)

Please let me know if you require more input


Thanks & Regards
Manish Banwari lal Yadav
thumbnail
Michele Zanarotti,修改在10 年前。

RE: copy encrypted passwords between different liferay installations.

Junior Member 帖子: 94 加入日期: 12-2-20 最近的帖子
I already proved to export users through the UI. I get an error that is well documented in these forums and in JIRA as a bug in the 6.0.

So exporting is not working. My only way is to re-create users , or read them from db, or make a portlet to do so. I can also make a new portlet for the destination server to import the exported users.

I need 2 portlets and i'm not going to create a portlet for a 6.0 version. I prefer to create that CSV starting from the Database. As you wrote, the essential fields are very simple to get.

My real problem is to know if that my method to transport passwords (as said in the first post) is correct.
thumbnail
Manish Yadav,修改在10 年前。

RE: copy encrypted passwords between different liferay installations.

Expert 帖子: 493 加入日期: 12-5-26 最近的帖子
Hi Michele Zanarotti,

Yes you can import password as you mention in your first post and restart of server.
But its not recommended to update DB directly.


You can create two portlets 1 for Export users and roles into Xml file and 2 for Import Users into Databases

Thanks & Regards
Manish Yadav