Migrating applications between Liferay environments is a common requirement during upgrades, environment refreshes, or production deployments. Whether you're moving custom Objects or Client Extensions, following the correct migration sequence is essential to avoid configuration issues and data inconsistencies.
Exporting and Importing Liferay Objects
Liferay Objects consist of two major components:
Object Definition – The schema that defines fields, relationships, validations, actions, and business logic.
Object Entries – The actual data stored within the object.
Important: Always migrate the Object Definition first, followed by the Object Entries.
1: Export the Object Definition
The Object Definition contains the complete structure of your object.
Steps
Navigate to:
Global Menu → Control Panel → Objects
Locate the required Object.
Click the Actions (⋮) menu.
Select Export Object Definition.
Liferay generates a JSON file containing:
Object fields
Relationships
Actions
Validations
Other object configurations
This JSON serves as the blueprint for recreating the object in another environment.
2: Import the Object Definition
Once the schema has been exported, import it into the target environment.
Steps
Navigate to:
Global Menu → Control Panel → Objects
Open the folder Actions menu.
Select Import Object Definition.
Upload the exported JSON file.
During import, Liferay uses the External Reference Code (ERC) to recreate the object while maintaining consistency across environments.
3: Export and Import Object Entries
After importing the object definition, migrate the data.
Option 1: Small Datasets
For smaller datasets, use the Data Migration Center.
Navigate to:
Global Menu → Applications → Data Migration Center
From there:
Select the required Object.
Export data as JSON or CSV.
Import the file into the target environment.
This method is simple and suitable for development or testing environments.
Option 2: Large Datasets
For production-sized datasets, Liferay recommends using a Batch Client Extension.
The process involves:
Exporting data into a
*.batch-engine-data.jsonfile.Packaging it as a Batch Client Extension.
Deploying it to the target Liferay instance.
This approach is more scalable and better suited for large volumes of data.
Comments
Post a Comment