Issue
- User needs to extract complete database structure of Liferay.
Environment
- Liferay DXP 7.0
- Liferay DXP 7.1
- Liferay DXP 7.2
Resolution
- Liferay does not have any OOTB functionality for extracting the DB structure. However, same can be done using third party tools at user's own discretion.
Additional Information
- Additionally, below information is regarding the DB tables that are more related to upgrade process, this might help only to get an idea about the table structure of Liferay DB.
- JournalArticle
- Id_: Id of the individual version of the journal article, this is not as useful as the resourcePrimKey or articleId, but can be used to help narrow down a specific row.
- resourcePrimKey: Used as the classPK in other tables when referencing a journalArticle. This column remains the same across all versions of the journalArticle.
- version: The version of the specific entry into the journalArticle table. In most cases, we care about the highest version as that is almost always what is shown to a user.
- articleId: Similar to the resourcePrimKey column in that it is the same between all versions of the journalArticle. It is used heavily in upgrades to keep track of a specific web content while upgrading it. We group versions into a single entity using the articleId.
- DDM
- DDMStructure
- structureId: Used as the primary identifier for a DDMStructure, this is also used as the classPK when referenced in other tables.
- classNameId: The type of entity this structure is associated with, for example, JournalArticle, DDLRecordset, KaleoProcess, etc.
- version(7.0+): The current version of the DDMStructure, the version shown in this table will always be the latest.
- definition: The actual structure behind the DDMStructure, in 7.0+ this is a JSON or XML object with the code for the structure.
- storageType: Informs what type of storage is used for the definition column. Usually JSON in 7.0+ and XML in 6.2 and below
- DDMTemplate
- templateId: Used as the primary identifier for a DDMTemplate, this is also used as the classPK when referenced in other tables.
- classNameId: This references the type of entity associated with the DDMTemplate
- classPK: Reference to the specific entity associated with this DDMTemplate.
- version(7.0+): The current version of the DDMTemplate, the version shown in this table will always be the latest.
- language: The language the script is written in
- script: The template script used to display a structure
- DDMStructure
- Document Library
- DLFileEntry
- fileEntryId: Primary identifier for the DLFilentry table, also used as the classPK in other tables.
- classNameId: When the DLFileEntry is associated with another entity like blogs, the classNameId will contain a value. If there is no associated entity with this DLFileEntry this value will be 0.
- classPK: When there is a value in the classPK column, that represents the specific entity this DLFileEntry is associated with. If there is no associated entity, this value will be 0.
- repositoryId: The id of the repository this document is stored in.
- folderId: The id of the folder this document is stored in.
- treePath: Used as part of building the file path to the document.
- fileName: The name of the file, also used to build the file path to the document.
- DLFileVersion
- fileVersionId: The primary identifier of a DLFileVersion
- repositoryId: The id of the repository this document is stored in.
- folderId: The id of the folder this document is stored in.
- treePath: Used as part of building the file path to the document.
- fileEntryId: The id of the DLFileEntry the version is assigned to.
- fileName: The name of the file, also used to build the file path to the document.
- version: The version of the DLFileEntry
- DLFileEntry
- Layout
- plid: This is a unique identifier for the layout.
- layoutId: This is the "internal" identifier for a given company and group and private/public setting.
- parentLayoutId: If this layout is a child, this will be the id of the parent layout.
- typeSettings: Holds information regarding how the layout is viewed. Each portlet on a layout is listed in the typeSettings, along with other information such as if the layout is private, and what type of template this layout should use.
- PorletPreferences
- portletPreferencesId: The primary key of the portletPreference.
- ownerType: Determines what type of entity the preferences are associated with. archived = 5, company = 1, group = 2, layout = 3, organization = 6, user = 4
- plid: when the ownerType is a layout, the plid is the layout’s plid, otherwise it is 0
- portletId: The specific id of the portlet the preferences are associated with
- preferences: The stored value of the portlet preferences, stored in an XML style.
- ResourcePermissions
- resourcePermissionId: The primary identifier for ResourcePermissions
- scope: The scope a resourcePermission is limited to. Company = 1, Group = 2, Group Template = 3, individual = 4.
- name: This represents whether this is Model Resource or portlet Resource
- actionIds: This is the total bitwise value of all actions that is assigned to the role on the resource.
- ClassName_
- classNameId: The primary identifier for this table, classNameId is also used in other tables to determine what type of object is stored in that row.
- value: The full Java class name for various objects in Liferay. This is used in conjunction with the classNameId.
- Release_
- servletContextName: The module this release record is associated with.
- schemaVersion: Determines which schema version the module associated with this release record is currently on. This is used by the upgrade process to determine which upgrade processes have run, and need to still be run.
- verified(7.2 and below): Determines if a verify process associated with this release record has run. 1 = verified, 0 = not verified.
- state: Determines if an upgrade was successful. 0 = successful, 1 = upgrade failure, 2 = verify failure (7.2 and below)
- Group_
- groupId: Used the primary key for rows in the group table and used in other tables to show an entity is associated with this group.
- classNameId: Determines what type of entity this group is associated with.
- classPK: The specific entity associated with the group.
- friendlyURL: The URL a group is accessed by in a browser
- Company
- companyId: Used as the primary identifier for each row, also used as an identifier in other tables to determine which company an entity belongs to.
- webId: The domain for the virtual instance
- mx: the domain for the mail exchange server
- active: Determines if a company is active or inactive. 0 = active, 1 = inactive.
- User_
- userId: Primary identifier for each column, used a classPK in other tables, also used in other tables to find users associated with the data they create.
- status: This determines if a user is active or inactive. 0 = active, 5 = inactive.
Note: Above details about Liferay DB tables is only to give an idea about some Liferay specific tables. Also, this are on record basis which may change adhering to different versions. - JournalArticle