Importing and Exporting Object entries

Issue

  • This article discusses how to export a copy of your Object entries, and import them into a new Object using the Import/Export Center which is a Feature Flag set by the property feature.flag.COMMERCE-8087=true.

Environment

  • Liferay DXP 7.4+
  • Liferay Quarterly Release 2023.Q3+
  • Liferay Experience Cloud (LXC) and Liferay Experience Cloud - Self-Managed (LXC-SM)

Resolution

This section will describe a scenario where we will (1) create an Object Definition, (2) add data entries into the Object Definition, (3) export the Object Definition, (4) delete the existing Object Definition, (5) recreate it with changes, (6) import the Object Definition, then (7) confirm that the import completed successfully. The scenario specifically describes how to workaround the issue specified in the article titled Unable to adjust the Mandatory status of a field after publishing the Object Definition.

1. Create a new Object definition called Test with a single Text field called Name that is Mandatory.
2. Go to the Object Test and add five entries.
3. Go to Product Menu > Applications > Import/Export Center.
4. Click the + icon, and click Export File
5. Select your object from Entity Type (in my case it is called C_Test (v1_0 - Liferay Object REST)) and ensure the object fields that are selected match your desired selection.
6. After clicking on Export, a modal will popup with a Download button. Click on this, and you will find export.zip
7. Extract export.zip and keep note of the export.json file's location
8. Delete or create another Object, and recreate it, this time ensuring that the "Name" field is no longer Mandatory.
9. After it is created in the same manner as the previous Test Object definition, go back to Product Menu > Applications > Import/Export Center
10. Click on the + icon, and click Import File
11. Select the export.json file from step 7, from the file picker
12. Select the Entity Type as the newly created Test Object definition without the mandatory field (in my case, it was called C_Test (v1_0 - Liferay Object REST)).
13. Confirm the Destination Field and Source File Field
14. Click Next to continue with the import.
15. After the import process completes, check the Test Object definition.

 

Additional Information

 

Was this article helpful?
0 out of 0 found this helpful