Legacy Knowledge Base
Published Sep. 10, 2025

Anonymizing Data

Written By

Michael Warren Young

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

Preserving anonymity of users when providing data to Liferay may be a concern for certain use-cases. The following guidelines should assist in determining which data should be anonymized and finding where 'sensitive' data can be located on Liferay's database.

Resolution

  1. Create a SQL script; set the username column for all tables to a dummy value (e.g. "Test")
  2. Create a SQL script that will anonymize user data:
    1. Contact_ table
      • firstName, lastName, middleName, userName, emailAddress.
      • Add other columns as desired, except: contactId, userId, classNameId, classPK
    2. User_ table
      • firstName, middleName, lastName,
      • Add other columns as desired, except: screenName, emailAddress
    3. Address table
      • Street1, street2, street3, city, zip
    4. Emailaddress table
      • Address
    5. Configuration_ table
      • This table can also contain passwords (for example, LDAP server connection, SAML config), so these specifically (but not other items on the table) should be replaced
  3. Create a SQL script that will reset User passwords
    1. Update User_.password_ to a dummy value (e.g. "test")
    2. Update User_.passwordEncrypted to 0 (setting to "0" ensures a users' password is not encrypted)
  4. Reset User_.screenName (value must be unique)
    1. Iterate through users and set screenname to unique dummy data (e.g. screenName = screenName + userId).
    2. Note: This should be done in Java code
  5. Reset User_.emailAddress (value must be unique)
    1. Iterate through users and set email address to unique dummy data (e.g. emailAddress = "test" + userId + "@test.com").
    2. Note: This should be done in Java code

Please note that the default user (default@liferay.com) should not be touched as a part of anonymizing the data.

Depending on how your Liferay Portal version is customized, other data may potentially need cleansing. Please be sure that any data inputted to the Liferay platform is in compliance with your local regulations.

Did this article resolve your issue ?

Legacy Knowledge Base