Users are not getting deleted from Liferay DB

血红的双手。 提交于 2019-12-04 18:40:53
Prakash K

Deactivate and Delete are two different functionalities.

When you Deactivate the user remains in the database and only the status is changed to deactivate. This is known as a soft-delete or logical-delete, i.e. the User deactivated will not be able to login, nor will he appear in any of the searches etc. But the advantage is that you can bring the User back to life by just Activate-ing the User. So this does not require you to re-create the User and also helps in keeping history or actions on the User.

If you want to delete the User from database, go to Control PanelUsers & Organizations → click on Search All Users → Search for the user either by Advanced or Basic Search → select the User(s) → Click Deactivate.

After this, do an Advanced Search → Select the status as Inactive → You will find all the de-activated users → select them and click Delete.

Hope this helps.


Edit

(thanks to @hudolejev for pointing this out in the comments below)

Please also note that the following property is set to true to delete users in portal-ext.properties, by default it is true:

#
# Set this to false if users cannot be deleted.
#
users.delete=true

Manual delete:

If you want to delete from the DB directly make sure you remove all records related to the user on the next tables:

DELETE FROM Users_UserGroups WHERE userId = 'userid';
DELETE FROM Users_Roles WHERE userId = 'userid';
DELETE FROM Users_Orgs WHERE userId = 'userid';
DELETE FROM Contact_ WHERE userId = 'userid';
DELETE FROM Group_ WHERE classPK = 'userid';
DELETE FROM User_ WHERE userId = 'userid';

When you just dectivate the User it still exists in the Liferay DB,So after each deactivation go and try to find the deactivated user and then delete it.

If you dont find user after deactivation, try to go to the Server administration and Reindex all search indexes. and then try again.

Regards Manish

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!