Forums

Home » Liferay Portal » English » 2. Using Liferay » General

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Rahul Chaturvedi
import users into liferay database by sql import statements
March 26, 2009 1:04 AM
Answer

Rahul Chaturvedi

Rank: New Member

Posts: 6

Join Date: March 26, 2009

Recent Posts

We need to create a batch process which would run separately and will import the users from an external system into liferay.
1. What we want is to create sql import statements that will insert the data into liferay database (we have pointed liferay 5.1.2 to a MySQL database) And then the users should be become the part of this liferay.

Could you please let me know what all tables needs to be updated for the same. As there must be multiple tables that needs to be updated if we import a user (one of them is User_ )
We would like to know the sql statements by which we can accomplish this.

2. Another information we require to know is how can this aforementioned import be done so that user is able to login in liferay with the same password present in external system. So in the sql statements do we need to give the cleartext value or encrypted value. Since we want liferay to save passwords in encrypted format so the security concern is addressed.
Manish Kumar Gupta
RE: import users into liferay database by sql import statements
March 26, 2009 2:55 AM
Answer

Manish Kumar Gupta

LIFERAY STAFF

Rank: Liferay Master

Posts: 535

Join Date: May 15, 2008

Recent Posts

I am just giving you another approach. Since, you are fetching data from an external system, you can use Liferay API to create users. This way, you will not be required to write SQL statements, no password security concern and no need to know what all tables are involved.

My 2 cents.
Rahul Chaturvedi
RE: import users into liferay database by sql import statements
March 26, 2009 4:39 AM
Answer

Rahul Chaturvedi

Rank: New Member

Posts: 6

Join Date: March 26, 2009

Recent Posts

Thanks Manish for your suggestion.

What we want is a separate batch process to take care of user imports. So creation of users using APIs in a batch would also do.

Could you please let me know the APIs (path to API) or sample code in case you have to which can take care of the task I want to achieve.
Manish Kumar Gupta
RE: import users into liferay database by sql import statements
March 26, 2009 7:47 AM
Answer

Manish Kumar Gupta

LIFERAY STAFF

Rank: Liferay Master

Posts: 535

Join Date: May 15, 2008

Recent Posts

See this file to get an idea on creating user by using LR api.

Let me know if you need any help.
Anonymous
RE: import users into liferay database by sql import statements
October 14, 2009 11:38 AM
Answer

Anonymous

Hello manish,
I have the same need, could you please explain how to use this patch to import users using liferay API. this is an emergency please
Thanks
Lisa Simpson
RE: import users into liferay database by sql import statements
October 19, 2009 8:56 AM
Answer

Lisa Simpson

Rank: Liferay Legend

Posts: 2034

Join Date: March 5, 2009

Recent Posts

Manesh,

This really belongs in the Wiki!!
Richard Sezov
RE: import users into liferay database by sql import statements
October 19, 2009 9:31 AM
Answer

Richard Sezov

LIFERAY STAFF

Rank: Regular Member

Posts: 198

Join Date: February 7, 2007

Recent Posts

You can use Liferay's web services to insert users. This approach has been taken by many users.

Please see the Liferay Portal Administrator's Guide, pp 244-247 for instructions on accessing Liferay's web services. You can generate a client from the WSDL very easily using any modern IDE (I've done it on both Eclipse and NetBeans) or Apache's wsdl2java utility. From there, just call the web service via a batch process whenever you want to insert a user.
Alistair Oldfield
RE: import users into liferay database by sql import statements
October 5, 2011 2:42 AM
Answer

Alistair Oldfield

Rank: New Member

Posts: 1

Join Date: February 21, 2011

Recent Posts

Hello,

We are also facing this issue, but using the API will not be enough. We are importing close to 1M users and this will take days.
Has anyone managed to accomplish this import using direct SQL statements (safely) into the DB?