g

Import/Export

With Import / Export Utility it is possible to export structural elements of the DXP like layouts and input types, and import them to another environment, i.e website. This makes working with multiple environments i.e. for development, QA and testing much easier. 


Import & Export are located in the System > Utilities area within the Core dna admin:


Export

Export is used to export “all” or “specific” entities & records from the website that can then be imported to another website on the Core dna platform. Entities that can be exported include “Layouts”, “Input Types”, “Custom Fields” and “Settings”. 


To define which entities to include in the export simply enable/disable the toggle next to each entity, for example:



Once an Entity is enabled the Records dropdown will show with a pre-selected value “All”, meaning that all the available layouts records on this site will be included in the export. To select only specific layouts click on the records dropdown and select the layouts that should be included instead, for example:


Repeat the same process with the other entities if required:



Once all the Entities & Records have been selected click the “Start Export” button to download the .json file that will include all the selected information:



Export.json file will download within your browser, if using Chrome the file should appear at the bottom left corner:


 


The exported file can now be imported to a new environment or website. Check the instructions in the “Import” section of this document on how complete the import.

View / Read JSON File

The JSON file can be read by opening it using the Notepad / or Code editor tool. The JSON content will be presenter in one line, to make it easier to read copy the content and view it on one of the free JSON viewer tools online, for example:

Exporting Layouts

Layouts can also contain supported layouts (i.e nested layouts), in which case all the supported layouts and used input types will be included in the export files. 


Example: if there is a requirement to move one component from one site to another, only the main “component” layout needs to be included in the export, and all the entities such as supported layouts and input types will be included in the export automatically. So there is no need to select the supported layouts or input types separately. But if you do it, every involved entity will be exported only once anyway.


Duplication Checks

In order to prevent duplication during importsupon export an “UUID” is generated and assigned to each exported entity, which is then checked on each import. 


Example One: In the event an user attempts to upload an export file twice the system will check the “UUID” first, if the “UUID” exists & “Update existing records” setting is disabled, the import will be skipped as the entities with the same “UUID” already exist. The same will happen if the user slightly modifies the Input Name and imports the file again, in this case the “UUID” will not change and the import will be skipped. However, if the “Update existing records” is enabled, then the new import (e.g. with modified Input Type name) will override the existing entities that share the same “UUID”. 


Example Two: In the event an user attempts to import two files that contain the same entities, but have different “UUID”, both files will be imported successfully - even if the “Update existing records” is disabled because the entities are unique, and most likely come from two different websites. 


Example Three: In the event an user attempts to import a record that contains an ”UUID” to a site that already has the same record, but does not have an “UUID” assigned. For example a “richtext” record. The import in this case will be executed, and the existing record which originally did not have an “UUID” will be updated with the “UUID” from the import file. 

Import

Now that we have exported the JSON file from one website, the same export file can now be imported to another website on Core dna. 


Note: template files are not included in the export, therefore they need to be separately uploaded via git. The export file only includes “Layouts”, “Input Types”, “Custom Field” & “Settings” information. 


In order to import the exported JSON file login to destination site and navigate to the System > Utilities > and click on the Import utility:



The Import page consists of the following main areas and settings:


Use case to enable “Update existing records”:


Use case to enable “Skip checksum checking”:


 
Checksum Enabled 

Checksum Disabled


Upon successful upload, all the entities within the export file will be added to the website and ready to use.