Tribune

Home » Liferay Portal » English » 3. Development

Vista Combinata Vista Piatta Vista ad Albero
Discussioni [ Precedente | Successivo ]
toggle
Michele Zanarotti
copy encrypted passwords between different liferay installations.
25 settembre 2013 7.06
Risposta

Michele Zanarotti

Punteggio: Junior Member

Messaggi: 84

Data di Iscrizione: 20 febbraio 2012

Messaggi recenti

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.
David H Nebinger
RE: copy encrypted passwords between different liferay installations.
25 settembre 2013 7.57
Risposta

David H Nebinger

Punteggio: Liferay Legend

Messaggi: 7900

Data di Iscrizione: 1 settembre 2006

Messaggi recenti

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.
Michele Zanarotti
RE: copy encrypted passwords between different liferay installations.
25 settembre 2013 11.07
Risposta

Michele Zanarotti

Punteggio: Junior Member

Messaggi: 84

Data di Iscrizione: 20 febbraio 2012

Messaggi recenti

Sorry, i didn't notice an export/import utility for users.

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

Thanks.
Manish Yadav
RE: copy encrypted passwords between different liferay installations.
26 settembre 2013 6.38
Risposta

Manish Yadav

Punteggio: Expert

Messaggi: 384

Data di Iscrizione: 26 maggio 2012

Messaggi recenti

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
Michele Zanarotti
RE: copy encrypted passwords between different liferay installations.
26 settembre 2013 9.12
Risposta

Michele Zanarotti

Punteggio: Junior Member

Messaggi: 84

Data di Iscrizione: 20 febbraio 2012

Messaggi recenti

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.
Manish Yadav
RE: copy encrypted passwords between different liferay installations.
27 settembre 2013 1.29
Risposta

Manish Yadav

Punteggio: Expert

Messaggi: 384

Data di Iscrizione: 26 maggio 2012

Messaggi recenti

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