Foros de discusión

Safe delete users from liferay database

avasek atok, modificado hace 8 años.

Safe delete users from liferay database

Junior Member Mensajes: 41 Fecha de incorporación: 9/01/15 Mensajes recientes
Hi,

Is there any query to safely delete all the users that i have imported from LDAP. I am using oracle DB. Some of the user groups and users in LDAP have got deleted but however the LDAP import is not cleaning all those deleted users in the liferay database.

Hence want to know if there is any safe query to clean delete all the LDAP users from the liferay database and re-import them back.

I thought of using API but however the count the is more and I have to build the logic to iterate through all the users and check if they really exists in LDAP else delete. I am feeling this is cumbersome compared to any database query

Thanks,
thumbnail
Meera Prince, modificado hace 8 años.

RE: Safe delete users from liferay database

Liferay Legend Mensajes: 1111 Fecha de incorporación: 8/02/11 Mensajes recientes
Hi
what if the users exist in the user_ table and reconnect with ldap then if the users already match with LDAP then it will be updated otherwise it will created new user record in liferay user_ table.
Delete user record from any sql query is not good way. if the case force you then you can use UserLocalServiceUtil.deleteUser(userId) API method. please have look fresh portal how many default users present then keep those and remove all .

Regards,
Meera Prince
avasek atok, modificado hace 8 años.

RE: Safe delete users from liferay database

Junior Member Mensajes: 41 Fecha de incorporación: 9/01/15 Mensajes recientes
Thanks Prince for responding, but however I have junk users which are not there in the central LDAP. They got removed from central LDAP but however we still have those junk users in the liferay system(Demoticon. Hence i looking for any query which can do the needful.

Thanks,
thumbnail
Patrick Wolf, modificado hace 8 años.

RE: Safe delete users from liferay database

Regular Member Mensajes: 127 Fecha de incorporación: 15/09/10 Mensajes recientes
Do you have many users to check? I ask this because it is not recommended to run such a query in the database as it is dangerous and may ruin the schema and relationships you get between the table User_ and other tables regarding permissions, content and document media created by those users. Even if this is a tedious job, I would recommend to do it from the Liferay administration back-end, but don't delete them, just deactivate them. If some of the users whom you delete own content or documents, you will get problems.